ninehills / blog

https://ninehills.tech
883 stars 80 forks source link

MacOS 启动项管理 #85

Closed ninehills closed 1 year ago

ninehills commented 3 years ago

起因是安装了 Citrix 后,发现首选项里无法配置是否开机启动,所以只能使用launchctl 来控制

# 当前用户(默认首个用户的uid为501,可以通过 id -u 查看)
launchctl print-disabled user/501
disabled services = {
    "com.docker.helper" => false
    "com.apple.ManagedClientAgent.enrollagent" => true
    "at.obdev.littlesnitch.agent" => false
    "5A4RE8SF68.com.tencent.xinWeChat.IPCHelper" => true
    "com.citrix.ServiceRecords" => true
    "com.apple.Siri.agent" => true
    "com.microsoft.update.agent" => false
    "io.tailscale.ipn.macos.login-item-helper" => true
    "com.cisco.anyconnect.notification" => true
    "com.citrix.ReceiverHelper" => true
    "com.apple.FolderActionsDispatcher" => false
    "com.oray.sunlogin.desktopagent" => true
    "com.citrix.AuthManager_Mac" => true
    "com.apple.appleseed.seedusaged.postinstall" => true
    "com.apple.ScriptMenuApp" => true
}
login item associations = {
    "version.com.docker.helper" => "64133"
    "com.docker.helper" => "com.docker.docker"
}
# 标记为true的,则为disable
# 如果想disable 某个服务,使用
launchctl disable user/501/com.citrix.AuthManager_Mac

# root用户
launchctl print-disabled system
# 操作同上,发现citrix 在system也有,相应的disabled掉