之前在脑残安装了一个很胃痛的 app,很快感觉很不好用,直接丢垃圾箱居然还失败,于是直接 sudo 然后把这个 app 强行删掉了。然后手动解析 pkg 一个一个删文件。teamviewer,对,说的就是这位。

过了几天检查系统 log 的时候,发现系统 log 还在报 teamviewer 启动失败什么的。这才记起来忘了删 launchctl 的启动项了。

launchctl 的启动项并不复杂,它的说明也很详细:

$ launchctl help

可以看到大致用法。

$ launchctl list

检查启动列表。可以很容易找到相应的内容。

$ sudo launchctl remove com.teamviewer.teamviewer
$ sudo launchctl remove com.teamviewer.desktop

然后就轻松把它收拾掉了。

此外,它还有残留,还需要到 /Library/LaunchAgent 再处理下。

cd /Library/LaunchAgent
sudo rm -rf com.teamviewer.teamviewer.plist com.teamviewer.teamviewer_desktop.plist

顺便一说,macOS 的东西还是用 brew 或者 app store 里面的东西就好,除此之外的东西,感觉最好谨慎些。就个人,我就下了个 mplayer。贸然下一些外面的 dmg 过来,对心灵简直是一种摧残。

Tip:

发现有删不了的启动项, 建议检查: /Library/LaunchAgent , /Library/LaunchDeamon 和 /Library/StartupItems , 包括系统的三个和自己的三个.

后来发现它自己也提供了删除的选项, 参考此处.

Reference:

Remove an Agent from launchd

Categories: Code

Yu

Ideals are like the stars: we never reach them, but like the mariners of the sea, we chart our course by them.

3 Comments

xqiushi · July 1, 2016 at 14:23

Google Chrome 51.0.2704.106 Google Chrome 51.0.2704.106 Windows 8.1 x64 Edition Windows 8.1 x64 Edition

最近电脑老是soagent占大量CPU,Google无果,不知道是不是什么没有删干净。

    yu · July 1, 2016 at 19:50

    Google Chrome 51.0.2704.103 Google Chrome 51.0.2704.103 Mac OS X  10.11.5 Mac OS X 10.11.5

    @xqiushi 没遇到过,google 了一下,看起来貌似是个坑…

      xqiushi · July 1, 2016 at 20:34

      Safari 9.1.1 Safari 9.1.1 Mac OS X  10.11.5 Mac OS X 10.11.5

      @yu
      大坑,无解。Chrome在我这儿也是坑,所以用Safar日常使用。特殊情况下才用Chrome

Leave a Reply to xqiushi Cancel reply

Your email address will not be published. Required fields are marked *