查看 macOS 当前用户会话里运行的 launchd 代理
用 launchctl list 列出用户域内所有代理的标签、PID 和上次退出状态,排查多余的后台程序。
运行 launchctl list(可加 | head -30 或 | grep 名称 过滤)查看用户域内每个服务的标签、PID 和退出码。
01命令
命令
$ launchctl list | head -3002作用说明
launchctl list 输出三列:服务标签、PID(显示短横线表示已加载但未运行)以及上次运行的退出码——非零退出码往往说明该服务反复崩溃。不加 sudo 时只列出你自己登录会话(gui/UID 域)里的服务,正好对应 ~/Library/LaunchAgents 中的用户级代理。需要某个条目的完整信息时,再用 launchctl print gui/$(id -u)/<标签> 深入查看。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- launchctl - Interfaces with launchd to manage services依据: Documents `launchctl list`: 'List all of the jobs loaded in their own domain' with PID, status and label columns; run without sudo it lists your user domain.
- launchctl(1) man page依据: Man page for launchctl: the `list` subcommand prints the label, PID (or '-' if not running) and last exit status of each service in the caller's domain.
最后验证: 2026-09-19 · 分类: 系统与设置