Search code examples
objective-cmacoscore-foundationlaunchd

Is there a way to load a LaunchAgent plist programmatically?


I am looking for an alternative way asides using NSTask/system() to run "launchctl load (plist)". Is there an API for this? Something like CFLaunchdHelper or NSLaunchd. I tried searching but didn't find any and TN2083 doesn't have any info about this.


Solution

  • Have a look at /usr/include/launch.h. A quick search revealed this link, seems useful.