用 xattr 清除隔离属性
查看并删除扩展属性——包括触发 Gatekeeper 拦截的隔离标记和 Finder 标签。
运行 `xattr -l <文件>` 查看属性,用 `xattr -r -d com.apple.quarantine <应用>` 递归清除隔离标记。
01命令
命令
$ xattr -r -d com.apple.quarantine /Applications/SomeApp.app02作用说明
浏览器或隔空投送下载的文件都带有 com.apple.quarantine 隐藏属性,这正是"无法打开,因为 Apple 无法检查"提示的来源。xattr 是系统自带的扩展属性工具,还能查看 Finder 颜色标签——它们本身就是属性。应用包必须加 -r,因为包内每个文件都可能带属性,只清单个文件解决不了整个应用。
03风险
!注意: 只对信任来源的软件清除隔离——这会绕过 Gatekeeper 提示。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- macOS xattr — display and manipulate extended attributes依据: Documents xattr -l, -d and -r for extended attribute inspection and removal.
最后验证: 2026-09-17 · 分类: 文件与文件夹