更新了macOSVentura后,系统设置页面大改
除了用户登陆项管理外还可以更改“允许在后台”项目
然而许多软件卸载后在“登陆项-允许在后台”会出现残留项目
下面给出解决方案
Terminal运行以下命令
sudo--bash-c'echo"-$(date)-";whileIFS=read-reachPlist;doecho"-$eachPlist";/usr/bin/defaultsread"$eachPlist";done<<<"$(/usr/bin/find/Library/LaunchDaemons/Library/LaunchAgents~/Library/LaunchAgents/private/var/root/Library/LaunchAgents/private/var/root/Library/LaunchDaemons-name"*.plist")";/usr/bin/defaultsreadcom.apple.loginWindowLogoutHook;/usr/bin/defaultsreadcom.apple.loginWindowLoginHook'>~/Desktop/launch.json查看桌面生成的JSON文件后寻找需要删除项目
可以通过WorkingDirectory项目判断是否该项目为卸载残留
例如下面项目需要删除
-/Users/saber/Library/LaunchAgents/com.shoplex.pandaclearproxy.plist{EnvironmentVariables={"DYLD_LIBRARY_PATH"="/Applications/Plex/Contents/Frameworks/";};KeepAlive=0;Label="com.shoplex.pandaclearproxy";ProgramArguments=("/Applications/Panda.app/Contents/MacOS/CloseProxy");RunAtLoad=1;WorkingDirectory="/Applications/Panda.app/Contents/MacOS";version="1.1.1";}根据路径执行以下命令即可删除
sudorm-f~/Library/LaunchAgents/com.shoplex.pandaclearproxy.plist详细检索“允许在后台”项目如果仍然有项目无法搜索到,运行以下命令并且查看生成的BTM.json
sfltooldumpbtm>~/Desktop/BTM.json查看后发现部分“允许在后台”项目在设置面板显示的是DeveloperName健值
也有部分显示的是Assoc.BundleIDs健值
具体情况可以自行对比上述命令生成的BTM.json与设置面板
例如下图的中的项目在查看了BTM.json后发现都是目前仍然在使用的应用程序
FuzhouWest2OnlineInternetInc:ClashXPro
HangzhouTuladingTechnologyCo.,Ltd:OneSwitch
如果需要删除
使用如下命令行
sudofind/Library/LaunchDaemons/Library/LaunchAgents~/Library/LaunchAgents-name"com.west2online.ClashXPro"-typef-deletecom.west2online.ClashXPro可以替换为其他需要删除的Assoc.BundleIDs对应健值