【macOS】删除“登陆项 - 允许在后台”卸载残留项目

✨“登陆项 - 允许在后台”

更新了macOS Ventura后,系统设置页面大改

除了用户登陆项管理外还可以更改“允许在后台”项目

image-20240325221112505

然而许多软件卸载后在“登陆项 - 允许在后台”会出现残留项目

下面给出解决方案


✨删除卸载残留“允许在后台”项目

Terminal运行以下命令

sudo -- bash -c 'echo " - $(date) -"; while IFS= read -r eachPlist; do echo "-$eachPlist"; /usr/bin/defaults read "$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/defaults read com.apple.loginWindow LogoutHook; /usr/bin/defaults read com.apple.loginWindow LoginHook' > ~/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";
}

根据路径执行以下命令即可删除

sudo rm -f ~/Library/LaunchAgents/com.shoplex.pandaclearproxy.plist

✨详细检索“允许在后台”项目

如果仍然有项目无法搜索到,运行以下命令并且查看生成的BTM.json

sfltool dumpbtm > ~/Desktop/BTM.json

查看后发现部分 “允许在后台” 项目在设置面板显示的是Developer Name健值

也有部分显示的是Assoc. Bundle IDs健值

具体情况可以自行对比上述命令生成的BTM.json与设置面板


例如下图的中的项目在查看了BTM.json后发现都是目前仍然在使用的应用程序

image-20240325221112506

Fuzhou West2Online Internet Inc:ClashX Pro

Hangzhou Tulading Technology Co., Ltd:One Switch


如果需要删除

使用如下命令行

sudo find /Library/LaunchDaemons /Library/LaunchAgents ~/Library/LaunchAgents -name "com.west2online.ClashXPro" -type f -delete

com.west2online.ClashXPro可以替换为其他需要删除的Assoc. Bundle IDs对应健值


✨参考及引用

https://discussionschinese.apple.com/thread/254445461?sortBy=best

https://discussionschinese.apple.com/thread/254375758?sortBy=best


⭐转载请注明出处

本文作者:双份浓缩馥芮白

原文链接:https://www.cnblogs.com/Flat-White/p/13501639.html

版权所有,如需转载请注明出处。

posted @ 2024-03-25 23:01  双份浓缩馥芮白  阅读(2531)  评论(0编辑  收藏  举报