5

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.
Community
  • 1
  • 1
Tarandeep Gill
  • 1,506
  • 18
  • 34

1 Answers1

11

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.
Zectbumo
  • 4,128
  • 1
  • 31
  • 26
  • 7
    heads up: looks like 10.10 now uses `/var/db/com.apple.xpc.launchd/disabled.$UID.plist` to keep track of enabled/disabled state. – rentzsch Jan 25 '15 at 03:48