MacOS/gatekeeper:修订间差异

来自OSSmedia
(创建页面,内容为“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…”)
 
 
第4行: 第4行:
=== 移除隔离标签<ref name=":0">MacOS论坛的回答<nowiki/>https://apple.stackexchange.com/questions/240557/forcing-open-command-to-open-unsigned-app</ref> ===
=== 移除隔离标签<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
  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


=== 为软件添加标签并允许此附带标签的软件执行<ref name=":0" /> ===
=== 为软件添加标签并允许此附带标签的软件执行<ref name=":0" /> ===

2024年4月9日 (二) 10:50的最新版本

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” 标签可以自己随便换