tags:

views:

225

answers:

2

We have a cross platform applicaton. The application has a feature to autostart it once the user logs in. How to do this in mac? from within the application. Manually adding it Login Items works but I am looking for how to do it using an API or something similar.

+1  A: 

You have to create a launchd property list file and place it in ~/Library/LaunchAgents or /Library/LaunchAgents, depending if you want the change system-wide or only for the current user.

This guide from Apple will help you accomplish that task.

Carmine Paolino
+1  A: 

If it's a GUI app adding it as a login item is the best way to go. Apple's dev note on the subject lists 3 ways to do this: with the Shared File Lists API, via Apple Events, or with the CFPreferences API.

Gordon Davisson