< MacOS
MacOS 的一套机制,可以阻止不信任的app启动。
让软件通过的方法
移除隔离标签[1]
xattr -r -d com.apple.quarantine /path/to/xyz.app
简便脚本
创建 /usr/local/bin/allow.sh
#!/bin/bash xattr -r -d com.apple.quarantine "$@"
使用方法
allow.sh your\ app.app
为软件添加标签并允许此附带标签的软件执行[1]
Create and add a Gatekeeper label to the app. (‘Approved’ is an arbitrary string.)
spctl --add --label "Approved" /path/to/xyz.app
Approve all apps with the label.
spctl --enable --label "Approved"
This only needs to be done once and adding the same named label to apps in the future automatically enables their access.
Open the app as usual.
open xyz.app
注意,这个“Approved” 标签可以自己随便换