launchctl interfaces with launchd to manage and inspect daemons, agents and XPC services.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
sudo launchctl procinfo 1
launchctl dumpstate
launchctl print system/com.openssh.sshd
launchctl print-cache
launchctl print-disabled system
launchctl limit/ulimit -a
launchctl error posix 0到159
launchctl error mach 0到52
launchctl error bootstrap 0到52
seq 0 159 | xargs -I{} launchctl error posix {}
seq 0 52 | xargs -I{} launchctl error mach {}
seq 0 52 | xargs -I{} launchctl error bootstrap {}
launchctl version
launchctl print gui/501
launchctl list com.apple.Finder

man macerror
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ sudo launchctl procinfo 585
program path = /usr/sbin/sshd
Could not print Mach info for pid 585: 0x5
argument count = 2
argument vector = {
 [0] = sshd: slave [priv]
 [1] =
Segmentation fault: 11
$ sudo launchctl procinfo 588
program path = /usr/sbin/sshd
Could not print Mach info for pid 588: 0x5
argument count = 2
argument vector = {
 [0] = sshd: slave@notty
 [1] =
Segmentation fault: 11