V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kiritoyui
V2EX  ›  Apple

launchctl 怎么删除无用的服务

  •  
  •   kiritoyui · 2023-09-15 10:26:29 +08:00 · 890 次点击
    这是一个创建于 460 天前的主题,其中的信息可能已经有所发展或是发生改变。

    launchctl print-disabled system 会显示很多无用的服务,比如说 anyconnect ,todesk ,sunlogin 等 这些软件早就删除了,尝试了 launchctl remove 和 launchctl unload (报错)均无法删除,请问该怎么删除无用的服务?

    sudo launchctl print-disabled system
    Password:
    
    	disabled services = {
    		"com.cisco.anyconnect.vpnagentd" => disabled
    		"org.pqrs.karabiner.karabiner_grabber" => disabled
    		"com.canonical.multipassd" => disabled
    		"com.netease.nemu-installer.smjob-retry-helper" => disabled
    		"com.sangfor.aTrustTunnel" => enabled
    		"com.tencent.Lemon.uninstall" => enabled
    		"com.youqu.todesk.service" => enabled
    		"com.netease.nemu-installer.smjob-helper" => enabled
    		"com.macpaw.CleanMyMac4.Agent" => enabled
    		"com.apple.CSCSupportd" => disabled
    		"com.cisco.anyconnect.ciscod64" => disabled
    		"com.oray.sunlogin.helper" => disabled
    		"com.apple.ftpd" => disabled
    		"com.apple.mdmclient.daemon.runatboot" => disabled
    		"fans" => enabled
    		"com.netease.nemu.startup" => enabled
    		"com.docker.socket" => enabled
    		"org.pqrs.karabiner.karabiner_observer" => enabled
    		"com.docker.vmnetd" => enabled
    		"com.tencent.Lemon.listen" => enabled
    		"com.tencent.QQMacMgr" => enabled
    		"com.oray.sunlogin.service" => enabled
    		"com.apple.bootpd" => disabled
    		"org.apache.httpd" => disabled
    		"com.microsoft.office.licensingV2.helper" => disabled
    		"com.bjango.istatmenus.daemon" => enabled
    		"com.sangfor.limit.maxfiles" => enabled
    		"org.pqrs.Karabiner-DriverKit-VirtualHIDDeviceClient" => enabled
    		"com.metacubex.ClashX.ProxyConfigHelper" => enabled
    		"com.iBoysoft.ntfsassistantd" => enabled
    		"com.soma-zone.LaunchControl.Helper" => enabled
    		"com.tencent.LemonDaemon" => enabled
    		"com.microsoft.autoupdate.helper" => enabled
    		"com.macpaw.zh.CleanMyMac4.Agent" => disabled
    		"com.cloudflare.1dot1dot1dot1.macos.warp.daemon" => enabled
    		"com.proxyman.NSProxy.HelperTool" => disabled
    		"com.apple.ftp-proxy" => disabled
    	}
    
    7 条回复    2023-09-16 20:45:54 +08:00
    MrKrabs
        1
    MrKrabs  
       2023-09-15 11:06:13 +08:00
    直接用 fd 搜 plist 删了得了
    lululau
        2
    lululau  
       2023-09-15 11:10:37 +08:00
    /Library/LaunchAgents
    /Library/LaunchDaemons
    $HOME/Library/LaunchAgents
    kiritoyui
        3
    kiritoyui  
    OP
       2023-09-15 13:38:34 +08:00
    @lululau 这些位置都没有,搜了一个出来 手动删了 launchctl print-disabled system 还是有
    IgniteWhite
        4
    IgniteWhite  
       2023-09-16 00:03:37 +08:00
    用 launchctl bootout 试试

    查一下 man launchctl ,会发现 load/unload 以及 remove 之类都已经是 legacy subcommands 了。现在用的是 bootstrap/bootout/kickstart 之类。legacy 的子命令在最近系统会有问题
    IgniteWhite
        5
    IgniteWhite  
       2023-09-16 00:04:34 +08:00
    我在这个帖子里介绍过一些关于 launchctl 的东西,可以参考 /t/967216
    IgniteWhite
        6
    IgniteWhite  
       2023-09-16 00:17:13 +08:00   ❤️ 1
    发现我上面两条答非所问了,原问题的解决办法是 https://apple.stackexchange.com/a/374520/350878
    kiritoyui
        7
    kiritoyui  
    OP
       2023-09-16 20:45:54 +08:00
    @IgniteWhite 谢谢,6 楼方法可行
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5067 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 09:41 · PVG 17:41 · LAX 01:41 · JFK 04:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.