Skip to content

macOS launchd, Processes and Logs Cheat Sheet

Quick-reference guide for managing launchd services, processes, and the unified log on macOS.


List All Loaded Services in Current Session:

launchctl list

Inspect Detailed State of a User Service (PID, Exit Code, Paths, Endpoints):

launchctl print gui/$(id -u)/[service_label]

Inspect Detailed State of a System Service:

sudo launchctl print system/[service_label]

Load & Start a User LaunchAgent (~/Library/LaunchAgents/):

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/[label].plist

Stop & Unload a User LaunchAgent:

launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/[label].plist

Force-Restart (kickstart) a Running Service Without Unloading:

launchctl kickstart -k gui/$(id -u)/[service_label]

Enable a Service Persistently Across Reboots:

launchctl enable gui/$(id -u)/[service_label]

Disable a Service Persistently Across Reboots:

launchctl disable gui/$(id -u)/[service_label]

List Homebrew Background Services:

brew services list

Start, Stop, or Restart a Homebrew Service:

brew services start [formula]
brew services stop [formula]
brew services restart [formula]

Kill a Process by Exact Name:

killall [ProcessName]

Kill Processes Matching a Pattern:

pkill -f [pattern]

Kill a Process Immediately by PID:

kill -9 [PID]

Stream Live Unified System Logs Filtered by Process:

log stream --predicate 'process == "sshd"' --info

Query Historical Unified System Logs (Last 1 Hour):

log show --predicate 'subsystem == "com.apple.network"' --last 1h --info --style compact

Sources & Verification

  • Built-in manual pages: run man <command> (for example man launchctl)