清理 Privacy & Security 下 Automation 和 Microphone 中的项
因为 automation和 microphone这两个分类下面都没有提供删除功能,当你想不重启电脑直接清理某些僵尸项,或者看着某些项碍眼,可以通过系统提供的命令行工具直接精准地删除或直接充值。
获取应用的 Bundle ID
要使用工具来清理,首先需要知道应用的 Bundle ID。这可以通过 osascript 来获取:osascript -e 'id of app "App full name"'。
比如:osascript -e 'id of app "Visual Studio Code"',返回 com.microsoft.VSCode。
使用隐私数据库管理工具 tccutil
tccutil 有两种用法,第一种是完全重置某一类,第二种是精准删除某类中的一项。
完全重置
完全从制 Automation:tccutil reset AppleEvents
完全充置 Microphone: tccutil reset Microphone
精准删除
精准删除就需要用到上面查到的 Bundle ID:tccutil reset Microphone com.microsoft.VSCode。
也可以查删一起:tccutil reset Microphone $(osascript -e 'id of app "Visual Studio Code"')