对于新版本的macOS,launchctl
语法和命令已更改。
在macOS High Sierra(10.13.4
)上进行了以下测试:
launchctl print user/$(id -u)
# For GUI domain (effectively "flat" with login domain)
# See man launchctl for details
launchctl print gui/$(id -u)
您可以使用launchctl print
和launchctl list
命令的变体查看附加到用户的系统上服务的许多属性。例如,要查看disabled标志的状态,请查找以下部分:
disabled services = {
{
"com.apple.macbuddy.icloudsetup.user" => false
"com.apple.ManagedClientAgent.enrollagent" => true
"com.apple.FileStatsAgent" => false
"com.apple.FolderActionsDispatcher" => true
"homebrew.mxcl.postgresql" => false
"com.apple.appleseed.seedusaged.postinstall" => true
"homebrew.mxcl.mysql" => false
}