前言

偶然在系统设置的 Login Items 管理中看到一个没有 Icon 的后台服务,如下图所示:

System Login Items

上图中的 TNT 项目就是一个看着比较奇怪的后台服务项,经过一番搜索才知道这是一个组织。

清理

macOS 的服务项配置文件常见目录有如下几个:

系统等录项

  • /Library/LaunchAgents
  • ~/Library/LaunchAgents
  • /System/Library/LaunchAgents

后台服务项

  • /Library/LaunchDaemons: 用户的后台服务项
  • /System/Library/LaunchDaemons: 系统的后台服务项

经过一番审查,并没有找到 TNT 相关的 plist 配置文件,然后看到网上有人提到 SMAppService,还有就是 sfltool

sudo sfltool dumpbtm

========================
 Records for UID 501 : B19E0E71-C33B-4262-B5CF-2C377D61330A
========================

 ServiceManagement migrated: true
 SharedFileList migrated: true

 Items:

 #1:
                 UUID: A93EB8AA-E850-4397-BEED-1F211F58E2F9
                 Name: CleanMyMac X Menu
       Developer Name: TNT - why join the navy if you can be a pirate
                 Type: app (0x2)
          Disposition: [disabled, allowed, visible, not notified] (2)
           Identifier: identifier "com.macpaw.CleanMyMac4.Menu" and certificate root = H"ac9832a814595d054047a2768d0bc7ea87e8486f"
                  URL: file:///Applications/CleanMyMac%20X.app/Contents/Library/LoginItems/CleanMyMac%20X%20Menu.app/
           Generation: 0
    Bundle Identifier: com.macpaw.CleanMyMac4.Menu

 #2:
                 UUID: F965419E-CC17-4EEA-8C4B-5994E20AC5BF
                 Name: CleanMyMac X HealthMonitor
       Developer Name: TNT - why join the navy if you can be a pirate
                 Type: login item (0x4)
          Disposition: [enabled, disallowed, visible, notified] (9)
           Identifier: identifier "com.macpaw.CleanMyMac4.HealthMonitor" and certificate root = H"ac9832a814595d054047a2768d0bc7ea87e8486f"
                  URL: Contents/Library/LoginItems/CleanMyMac%20X%20HealthMonitor.app
           Generation: 6
    Bundle Identifier: com.macpaw.CleanMyMac4.HealthMonitor
    Parent Identifier: identifier "com.macpaw.CleanMyMac4.Menu" and certificate root = H"ac9832a814595d054047a2768d0bc7ea87e8486f"
 #4:
                 UUID: 0BEF0D2C-623C-4D56-B50F-E7DB6498C24F
                 Name: Microsoft AutoUpdate
       Developer Name: Microsoft AutoUpdate
      Team Identifier: UBF8T346G9
                 Type: curated legacy agent (0x90008)
          Disposition: [enabled, allowed, visible, notified] (11)
           Identifier: com.microsoft.update.agent
                  URL: file:///Library/LaunchAgents/com.microsoft.update.agent.plist
      Executable Path: /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft Update Assistant.app/Contents/MacOS/Microsoft Update Assistant
           Generation: 1
    Assoc. Bundle IDs: [com.microsoft.autoupdate2 ]
    Parent Identifier: Microsoft AutoUpdate

通过这个命令可以输出系统的等录项和后台服务项相关注册信息,然后找到对应的 plist 文件再删除即可!

I hope this is helpful, Happy hacking…