删除 MAC 允许在后台下的 APP 项

MAC 允许在后台 登录

Posted by gomyck on January 6, 2025

运行下面的命令, 会在桌面生成所有登录享和允许在后台项的列表, 查看列表, 根据每项的描述, 删除对应的文件即可

1
$ 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.txt

看 第一行 与 Program 对应的文件, 删除即可

1
2
3
4
5
6
7
8
9
10
11
12
-/Library/LaunchDaemons/com.microsoft.OneDriveStandaloneUpdaterDaemon.plist
{
    Label = "com.microsoft.OneDriveStandaloneUpdaterDaemon";
    MachServices =     {
        "com.microsoft.OneDriveStandaloneUpdaterDaemon" = 1;
    };
    Program = "/Applications/OneDrive.app/Contents/StandaloneUpdaterDaemon.xpc/Contents/MacOS/StandaloneUpdaterDaemon";
    ProgramArguments =     (
    );
    StandardErrorPath = "/Library/Logs/Microsoft/OneDrive/OneDriveStandaloneUpdaterDaemon.log";
    StandardOutPath = "/Library/Logs/Microsoft/OneDrive/OneDriveStandaloneUpdaterDaemon.log";
}