跳到正文
asc-cli 技能手冊

asc-notarization

macOS 公證

使用 Developer ID 簽名完成 macOS 應用的封存、匯出與公證。

覆蓋 App Store 之外分發 macOS 應用所需的完整鏈路:封存 → Developer ID 匯出 → 壓縮 → 提交公證(asc notarization)→ 裝訂(可選,使用 xcrun stapler),並幫助排查 Developer ID 簽名或信任鏈問題。

適用場景

  • 需要為 App Store 之外的分發對 macOS 應用做公證時
  • 想走完整流程:封存 → Developer ID 匯出 → 壓縮 → 公證 →(可選)裝訂時
  • 排查 Developer ID 簽名或信任鏈問題時

命令示例

大寫佔位符(如 APP_ID、BUILD_ID)請替換為你自己的值;標有「對智慧代理說」的行是給 AI 智慧代理的提示詞,不會被複制。

zsh
# 封存並以 Developer ID 方式匯出(交給智慧代理執行 xcodebuild)
對智慧代理說封存我的 macOS 應用,以 Developer ID 方式匯出並壓縮為 zip
# 提交公證並等待結果;失敗時檢視開發者日誌
$asc notarization submit --file "./YourApp.zip" --wait
$asc notarization log --id "SUBMISSION_ID"
# 公證透過後裝訂票據(Apple 自帶工具,非 asc 命令)
$xcrun stapler staple "./YourApp.app"

安裝此技能

安裝 asc 後執行下面的命令即可一次性安裝全部技能,其中包含 asc-notarization。

zsh
$asc install-skills