launchctl Command Examples

Control Apple's launchd manager for launch daemons (system-wide services) and launch agents (per-user programs). launchd loads XML-based *.plist files placed in the appropriate locations, and runs the corresponding commands according to their defined schedule. More information: https://keith.github.io/xcode-man-pages/launchctl.1.html.

launchctl load ~/Library/LaunchAgents/{{my_script}}.plist

sudo launchctl load /Library/LaunchAgents/{{root_script}}.plist

sudo launchctl load /Library/LaunchDaemons/{{system_daemon}}.plist

launchctl list

launchctl unload ~/Library/LaunchAgents/{{my_script}}.plist

launchctl start {{script_file}}

launchctl stop {{script_file}}