Mac OS X: Loading and Unloading with launchd
In Mac OS X you can use cron to schedule tasks but you can also use launchd. Â To use launchd to load or unload an agent where you’ve setup a task use the launchctl command. Â Here we will use launchctl to manually start a process given that we defined a plist called /Library/LaunchAgents/com.apple.OpenProgram.plist (where program is maybe the name of some program you want to fire up):
launchctl load Library/LaunchAgents/com.apple.OpenProgram.plist
Your application should fire up now. Â Do not quit it for ten seconds. Wait about 15, then quit it. Notice it start up again. This is because it is a launchAgent and will restart any time it is closed. Â Now run:
launchctl unload Library/LaunchAgents/com.apple.OpenProgram.plist
Watch your program close.
Similar Articles:
- Mac OS X: Enable and Disable Spotlight
- Creating a LaunchAgent
- Command Line ALF on Mac OS X
- Command Line ALF Redux
- Monitoring/Restarting Retrospect
In: Mac OS X, Mac OS X Server, Mac Security · Tagged with: launchagents, launchctl, launchd, Mac OS X


