简体   繁体   中英

Launch app at login in OS X 10.10 Yosemite

I need to add my application to the login items in the system preferences when then user presses a button. I've seen other answers around Stack Overflow, but many of them rely on <10.8 or <10.10 and deprecated APIs like LSSharedFileServices. Some of the answers refer to LSSharedFileServices, to which I can't find the documentation on Apple's website.

I did find this but it seems like that is vastly over-engineered.

Should I just give up on Cocoa and use a bash script?

The website you mentioned is a very good approach. It seemes over-engineered, but it is quite simple to implement. I used this idea myself and it is ok for the Mac App Store. You should give it a try, if you don't like it, you can still look for something else

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM