用 spctl --assess 查询 Gatekeeper 判定结果
spctl 会按 macOS 的 Gatekeeper 策略评估任意应用,并告诉你接受或拒绝的具体原因。
运行 `spctl --assess --verbose /Applications/SomeApp.app`,即可查看 Gatekeeper 是否接受该应用以及依据。
01命令
命令
$ spctl --assess --verbose /Applications/SomeApp.app02作用说明
spctl --assess 使用的正是应用启动时 Gatekeeper 的同一套系统策略:accepted 表示该应用由受认可的开发者签名并通过了苹果公证。--verbose 会显示判定来源,例如 accepted source=Notarized Developer ID。还可以运行 `spctl --status` 查看 Gatekeeper 是否全局开启。注意它只做评估,不会启动或修改目标应用。
03风险
!注意: 判定为 accepted 只代表符合策略,不代表软件绝对安全;对来源不明的应用仍需保持警惕。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Protecting against malware (Apple Platform Security)依据: Apple's security guide explains Gatekeeper and notarization assessments performed on downloaded apps.
- spctl — system policy security assessment tool (macOS)依据: Documents --assess to evaluate a path against system policy and --verbose to show the reason for the verdict.
最后验证: 2026-09-17 · 分类: 安全与隐私