launchctl — Control Services and Daemons with launchd
Practical guide to launchctl — load, start, stop and manage macOS daemons and agents with the modern bootstrap/bootout syntax.
launchctl is the command-line tool you use to control launchd – the central service manager of macOS that loads, starts and stops daemons and agents. Services are described by property list files (plists) living in the LaunchDaemons and LaunchAgents directories; launchctl registers them, unloads them again and shows you their status. This guide walks you through the commands you reach for most – from querying status to the modern bootstrap/bootout workflow and enabling services at startup.
List & Info
launchctl list — List all loaded services for the current user.
launchctl listlaunchctl list | grep <name> — Search for a specific service.
launchctl list | grep sshlaunchctl print system/<label> — Show detailed info about a system service.
sudo launchctl print system/com.apple.sshdlaunchctl print gui/$(id -u)/<label> — Show detailed info about a user service.
launchctl print gui/$(id -u)/com.apple.Spotlightlaunchctl blame system/<label> — Show why a service is running or not.
sudo launchctl blame system/com.apple.sshdStart & Stop (Modern)
launchctl bootstrap system <plist> — Load and register a system daemon.
sudo launchctl bootstrap system /Library/LaunchDaemons/com.example.myservice.plistlaunchctl bootout system/<label> — Unload and deregister a system daemon.
sudo launchctl bootout system/com.example.myservicelaunchctl bootstrap gui/$(id -u) <plist> — Load a user agent.
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.example.myagent.plistlaunchctl bootout gui/$(id -u)/<label> — Unload a user agent.
launchctl bootout gui/$(id -u)/com.example.myagentlaunchctl kickstart -k system/<label> — Force restart a service (kill and relaunch).
sudo launchctl kickstart -k system/com.apple.sshdlaunchctl kickstart -p system/<label> — Start a service if it's not running.
sudo launchctl kickstart -p system/com.example.myserviceLegacy Commands
launchctl load <plist> — Load a service (legacy, use bootstrap instead).
launchctl load ~/Library/LaunchAgents/com.example.myagent.plistlaunchctl unload <plist> — Unload a service (legacy, use bootout instead).
launchctl unload ~/Library/LaunchAgents/com.example.myagent.plistlaunchctl load -w <plist> — Load and enable a service permanently.
launchctl load -w ~/Library/LaunchAgents/com.example.myagent.plistlaunchctl unload -w <plist> — Unload and disable a service permanently.
launchctl unload -w ~/Library/LaunchAgents/com.example.myagent.plistlaunchctl start <label> — Start an already loaded service.
launchctl start com.example.myagentlaunchctl stop <label> — Stop a running service.
launchctl stop com.example.myagentEnable & Disable
launchctl enable system/<label> — Enable a system service to start at boot.
sudo launchctl enable system/com.example.myservicelaunchctl disable system/<label> — Disable a system service from starting at boot.
sudo launchctl disable system/com.example.myservicelaunchctl enable gui/$(id -u)/<label> — Enable a user agent to start at login.
launchctl enable gui/$(id -u)/com.example.myagentlaunchctl disable gui/$(id -u)/<label> — Disable a user agent from starting at login.
launchctl disable gui/$(id -u)/com.example.myagentPlist Locations
~/Library/LaunchAgents/ — User agents: run when the user logs in.
ls ~/Library/LaunchAgents//Library/LaunchAgents/ — Global agents: run for all users at login.
ls /Library/LaunchAgents//Library/LaunchDaemons/ — Global daemons: run at boot (as root).
ls /Library/LaunchDaemons//System/Library/LaunchDaemons/ — System daemons (Apple, do not modify).
ls /System/Library/LaunchDaemons/ Conclusion
launchctl bundles the entire service control of macOS into a single command – from a quick launchctl list to a targeted restart of an individual daemon. For day-to-day work, reach for the modern syntax with bootstrap and bootout; the old load/unload still works but is considered legacy and doesn't understand the domain separation (system, gui, user). The system domain requires sudo, and that's exactly where caution pays off: a bootout or disable on an Apple daemon can break core macOS functionality – so leave the plists under /System/Library/LaunchDaemons/ alone. When a service misbehaves, launchctl blame often points you to the cause faster than digging through logs.
Further Reading
- launchd – Apple Developer Documentation – official guide to creating daemons and agents
- launchctl(1) – command reference – overview of all subcommands and options
Related Commands
- caffeinate – prevent the Mac from going to sleep
- defaults – read and write macOS settings stored in plists
- diskutil – manage disks, volumes and partitions