Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SMLoginItemSetEnabled, App does not show under "Login Items"

I am using SMLoginItemSetEnabled to launch an app on login. Everything works fine, except that the App does not show under "Login Items" in the "User Preferences" window. I have tried this in OS X Lion.

  1. Is this the expected behavior?
  2. Is there a way to manually stop the App from launching on login? I can't find anything in /Library/LaunchDaemons or /Library/LaunchAgents.
like image 784
Tarandeep Gill Avatar asked Feb 11 '13 12:02

Tarandeep Gill


1 Answers

This is expected behavior. Apple Daemons and Services Programming Guide says:

Login items installed using the Service Management framework are not visible in System Preferences and can only be removed by the application that installed them.


Yes, just change Disabled to true for your bundle identifier in launchd's overrides.plist. I wrote you a command to do just this:

/usr/libexec/PlistBuddy -c 'Set :com.yourcompany.helper-CFBundleIdentifier-here:Disabled true' /var/db/launchd.db/com.apple.launchd.peruser.$UID/overrides.plist
  • Note: Replace com.yourcompany.helper-CFBundleIdentifier-here with your BundleIdentifier.
like image 140
Zectbumo Avatar answered Oct 20 '22 01:10

Zectbumo