Community编程与开发github.com

rudrankriyam/asc-notarization

使用 xcodebuild 和 asc 对 macOS 应用进行归档、导出和公证。当你需要为 Mac App Store 外部分发 macOS 应用,并需要 Developer ID 签名和 Apple 公证时使用。

asc-notarization 是什么?

此技能提供了一套完整的 macOS 应用分发工作流,涵盖从 Xcode 归档、Developer ID 签名到 Apple 公证的整个过程。它基于 xcodebuild 和 Apple 安全命令行工具 (asc) 构建,能够自动化处理非 App Store 分发的必要步骤。这对于需要将 macOS 应用发布到网站直接分发给用户的开发者来说至关重要,确保应用符合苹果的 Gatekeeper 安全策略。该技能支持并自动处理归档、导出(带硬绑定运行时和可选票根)、公证以及公证票嵌操作,同时还集成了 Team ID 和 Bundle ID 的自动提取,从而简化整个分发流水线。

兼容平台~Claude Code~Codex CLI~Cursor
Part ofMobile
npx skills add https://github.com/rudrankriyam/app-store-connect-cli-skills/tree/main/skills/asc-notarization

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

asc-notarization 是做什么的?

使用 xcodebuild 和 asc 对 macOS 应用进行归档、导出和公证。当你需要为 Mac App Store 外部分发 macOS 应用,并需要 Developer ID 签名和 Apple 公证时使用。

功能

  • 归档:编译并归档 Xcode 项目(使用 xcodebuild archive)
  • 导出:将归档导出为已签名的 Developer ID 应用包(使用 xcodebuild -exportArchive,带 -allowProvisioningUpdates 和 -authenticationKeyPath)
  • 公证:将应用提交到 Apple 公证服务(使用 xcrun notarytool submit)
  • 票嵌:将公证票嵌入到应用包中(使用 xcrun stapler staple)
  • 支持平台:macOS

使用方法

前提条件

  • Xcode 命令行工具已安装。
  • 一个有效的 Apple Developer ID 证书和 Team ID。
  • 一个有效的 App Store Connect API 密钥(用于公证)。

归档应用

xcodebuild archive -scheme "MyApp" -archivePath "$PWD/build/MyApp.xcarchive" -allowProvisioningUpdates -authenticationKeyPath "~/.appstoreconnect/private_keys/AuthKey_XXXXXXXXXX.p8"

导出应用

xcodebuild -exportArchive -archivePath "$PWD/build/MyApp.xcarchive" -exportPath "$PWD/build/MyApp" -exportOptionsPlist "exportOptions.plist" -allowProvisioningUpdates -authenticationKeyPath "~/.appstoreconnect/private_keys/AuthKey_XXXXXXXXXX.p8"

公证应用

xcrun notarytool submit "$PWD/build/MyApp/MyApp.app" --key "~/.appstoreconnect/private_keys/AuthKey_XXXXXXXXXX.p8" --key-id "XXXXXXXXXX" --issuer "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" --wait

嵌入公证票

xcrun stapler staple "$PWD/build/MyApp/MyApp.app"

exportOptions.plist 示例

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>developer-id</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>teamID</key>
    <string>YOUR_TEAM_ID</string>
    <key>compileBitcode</key>
    <false/>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>

自动化脚本示例

#!/bin/bash

SCHEME="MyApp"
WORKSPACE="MyApp.xcworkspace"
ARCHIVE_PATH="$PWD/build/MyApp.xcarchive"
EXPORT_PATH="$PWD/build/MyApp"
EXPORT_OPTIONS="exportOptions.plist"
API_KEY_PATH="~/.appstoreconnect/private_keys/AuthKey_XXXXXXXXXX.p8"

# 步骤 1:归档
xcodebuild archive -workspace "$WORKSPACE" -scheme "$SCHEME" -archivePath "$ARCHIVE_PATH" -allowProvisioningUpdates -authenticationKeyPath "$API_KEY_PATH"

# 步骤 2:导出
xcodebuild -exportArchive -archivePath "$ARCHIVE_PATH" -exportPath "$EXPORT_PATH" -exportOptionsPlist "$EXPORT_OPTIONS" -allowProvisioningUpdates -authenticationKeyPath "$API_KEY_PATH"

# 步骤 3:公证
xcrun notarytool submit "$EXPORT_PATH/$SCHEME.app" --key "$API_KEY_PATH" --key-id "XXXXXXXXXX" --issuer "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" --wait

# 步骤 4:嵌入公证票
xcrun stapler staple "$EXPORT_PATH/$SCHEME.app"

环境变量

  • APP_STORE_CONNECT_API_KEY_PATH: App Store Connect API 密钥的文件路径。
  • APP_STORE_CONNECT_API_KEY_ID: App Store Connect API 密钥的 ID(密钥 ID)。
  • APP_STORE_CONNECT_API_ISSUER: App Store Connect API 密钥的颁发者 ID。
  • TEAM_ID: 你的 Apple Developer Team ID。
  • BUNDLE_ID: 你的应用 Bundle ID(如 com.example.MyApp)。

注意事项

  • 此技能仅支持 macOS。
  • 确保你的 API 密钥具有 Developer Tools 权限(在 App Store Connect 中启用)。
  • 签名和公证过程可能需要几分钟。如果遇到超时错误,请重试。
  • 请使用 --wait 标志等待公证完成后再继续操作。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

rudrankriyam/asc-app-create-ui

Create a new App Store Connect app record via browser automation. Use when there is no public API for app creation and you need an agent to drive the New App form.

rudrankriyam/asc-aso-audit

Run an offline ASO audit on canonical App Store metadata under `./metadata` and surface keyword gaps using Astro MCP. Use after pulling metadata with `asc metadata pull`.

rudrankriyam/asc-build-lifecycle

Track build processing, find latest builds, and clean up old builds with asc. Use when managing build retention or waiting on processing.

rudrankriyam/asc-cli-usage

Guidance for using asc cli in this repo (flags, output formats, pagination, auth, and discovery). Use when asked to run or design asc commands or interact with App Store Connect via the CLI.

rudrankriyam/asc-crash-triage

Triage TestFlight crashes, beta feedback, and performance diagnostics using asc. Use when the user asks about TF crashes, TestFlight crash reports, beta tester feedback, app hangs, disk writes, launch diagnostics, or wants a crash summary for a build or app.

rudrankriyam/asc-id-resolver

Resolve App Store Connect IDs (apps, builds, versions, groups, testers) from human-friendly names using asc. Use when commands require IDs.

rudrankriyam/asc-localize-metadata

Automatically translate and sync App Store metadata (description, keywords, what's new, subtitle) to multiple languages using LLM translation and asc CLI. Use when asked to localize an app's App Store listing, translate app descriptions, or add new languages to App Store Connect.

rudrankriyam/asc-metadata-sync

Sync, validate, and apply App Store metadata with the current asc canonical metadata workflow. Use when updating metadata, localizations, keywords, or migrating legacy fastlane metadata.

rudrankriyam/asc-ppp-pricing

Set territory-specific pricing for subscriptions and in-app purchases using current asc setup, pricing summary, price import, and price schedule commands. Use when adjusting prices by country or implementing localized PPP strategies.

rudrankriyam/asc-release-flow

Determine whether an app is ready to submit, then drive the current App Store release flow with asc, including validation, staging, review submission, first-time availability, subscriptions, IAP, Game Center, and App Privacy checks.

rudrankriyam/asc-revenuecat-catalog-sync

Reconcile App Store Connect subscriptions and in-app purchases with RevenueCat products, entitlements, offerings, and packages using asc and RevenueCat MCP. Use when setting up or syncing subscription catalogs across ASC and RevenueCat.

rudrankriyam/asc-shots-pipeline

Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (`asc screenshots frame`), and screenshot upload (`asc screenshots upload`). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition, or screenshot-to-upload pipelines.

rudrankriyam/asc-signing-setup

Set up bundle IDs, capabilities, signing certificates, provisioning profiles, and encrypted signing sync with the asc cli. Use when onboarding a new app, rotating signing assets, or sharing them across a team.

rudrankriyam/asc-submission-health

Validate App Store submission readiness, submit prepared versions, and monitor review status with current asc commands. Use when shipping or troubleshooting review submissions.

rudrankriyam/asc-subscription-localization

Bulk-localize subscription and in-app purchase display names across all App Store locales using asc. Use when you want to fill in subscription/IAP names for every language without clicking through App Store Connect manually.

rudrankriyam/asc-testflight-orchestration

Orchestrate TestFlight distribution, groups, testers, and What to Test notes using asc. Use when rolling out betas.

rudrankriyam/asc-wall-submit

Submit or update a Wall of Apps entry in the App-Store-Connect-CLI repository using `asc apps wall submit`. Use when the user says "submit to wall of apps", "add my app to the wall", or "wall-of-apps".

rudrankriyam/asc-whats-new-writer

Generate engaging, localized App Store release notes (What's New) from git log, bullet points, or free text using canonical metadata under `./metadata`. Optionally pairs with promotional text updates.

rudrankriyam/asc-workflow

Define, validate, run, resume, and audit repo-local multi-step automations with current `asc workflow` and `.asc/workflow.json`, including step outputs and safe release/TestFlight workflows.

rudrankriyam/asc-xcode-build

Build, archive, export, upload, and manage Xcode version/build numbers with the current asc xcode helpers before App Store Connect upload or submission. Use when creating an IPA or PKG for upload.

相关技能