MacOS/gatekeeper

来自OSSmedia
Brucekomike讨论 | 贡献2024年4月9日 (二) 10:43的版本 (创建页面,内容为“MacOS 的一套机制,可以阻止不信任的app启动。 == 让软件通过的方法 == === 移除隔离标签<ref name=":0">MacOS论坛的回答<nowiki/>https://apple.stackexchange.com/questions/240557/forcing-open-command-to-open-unsigned-app</ref> === xattr -r -d com.apple.quarantine /path/to/xyz.app === 为软件添加标签并允许此附带标签的软件执行<ref name=":0" /> === Create and add a Gatekeeper label to the app. (‘Approved’ is…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

MacOS 的一套机制,可以阻止不信任的app启动。

让软件通过的方法

移除隔离标签[1]

xattr -r -d com.apple.quarantine /path/to/xyz.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” 标签可以自己随便换