Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I launch an application on system startup? (Mac OSX, Cocoa)

I have a program that runs only in the toolbar (w/ time/date, spotlight, etc.) and I want to put an item in the preferences to allow the user to select whether to start my application on the system startup or not. I'm currently lost on where to find some documentation on this. Any links or short code snippets would be much appreciated. Thanks in advance!

like image 841
Kyle Zaragoza Avatar asked Jul 08 '10 16:07

Kyle Zaragoza


2 Answers

You need to add the app to login items.

See System Startup Programing Topics: Customizing Login and Logout

like image 103
TechZen Avatar answered Nov 13 '22 00:11

TechZen


There are some different solutions to that but Apple wants you to use the launchd(8).

Refer to this one (different section from the already mentioned documentation, since the topic starter asked for 'system startup', not 'when a user logs in') for some further information.

like image 3
aprodigy Avatar answered Nov 12 '22 23:11

aprodigy