方法一
定时任务执行 defaults write com.apple.systempreferences AttentionPrefBundleIDs 0
复制一下代码保存为 com.cleanUpdate.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.cleanupdate</string>
<key>ProgramArguments</key>
<array>
<string>defaults</string>
<string>write</string>
<string>com.apple.systempreferences</string> <string>AttentionPrefBundleIDs</string>
<string>0</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key> <string>/tmp/com.cleanupdate.err</string>
<key>StandardOutPath</key>
<string>/tmp/com.cleanupdate.out</string>
<key>StartInterval</key>
<integer>10</integer>
</dict>
</plist>
把文件保存在到 ~/资源库/LaunchAgents/
终端输入:
launchctl load -w com.cleanUpdate.plist
然后再输入
launchctl start -w com.cleanUpdate.plist
关闭方法
launchctl stop com.cleanUpdate.plist
方法二
许多方法实际效果是只能短暂有用,一重启了或杀dock,红色角标又回来显示了。一劳永逸的方法是解决更新的后台SoftwareUpdateNotificationManager。不但禁止更新,还抹了红色更新角标。
终端输入三个命令:
sudo mount -uw /
sudo chmod 600 /System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdateNotificationManager.app/Contents/MacOS/SoftwareUpdateNotificationManager
defaults write com.apple.systempreferences AttentionPrefBundleIDs 0;killall Dock
恢复命令:
sudo mount -uw /
sudo chmod 777 /System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdateNotificationManager.app/Contents/MacOS/SoftwareUpdateNotificationManager
defaults write com.apple.systempreferences AttentionPrefBundleIDs 0;killall Dock