asc-builds-archive について
`asc` で Xcode プロジェクトをアーカイブし、IPA/PKG を書き出して、必要に応じて App Store Connect にアップロードするスキルです。複数の Apple プラットフォームと書き出し・署名設定に対応します。
主な機能
- 01`xcodebuild` によるプロジェクトのアーカイブ
- 02IPA または PKG の書き出し
- 03App Store Connect への任意アップロード
- 04プラットフォーム・書き出し方法・署名方式の選択
活用シーン
- 01iOS ビルドを TestFlight 向けに準備
- 02登録済みデバイス向けに Ad Hoc ビルドを作成
- 03macOS プロジェクトをアップロードせずにアーカイブ
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ tddworks/ asc-cli-skills --skill asc-builds-archiveインストール後、Claude Code で/asc-builds-archiveを入力して読み込まれたか確認します。
同梱ファイルreferences/workflow.md
詳細
asc ビルドのアーカイブとエクスポート
Xcode プロジェクトをアーカイブし、IPA/PKG バイナリをエクスポートして、必要に応じて App Store Connect にアップロードします。すべてを 1 つのコマンドで実行できます。エンドツーエンドのフロー全体については、workflow.md を参照してください。
コマンド
アーカイブとエクスポート
asc builds archive \
--scheme <SCHEME_NAME> \
[--workspace MyApp.xcworkspace] # auto-detected from cwd
[--project MyApp.xcodeproj] # auto-detected from cwd
[--platform ios|macos|tvos|visionos] # default: ios
[--configuration Release] # default: Release
[--export-method app-store-connect|ad-hoc|development|enterprise] # default: app-store-connect
[--signing-style automatic|manual] # default: automatic
[--team-id ABCD1234] # team ID for signing
[--output-dir .build] # default: .build
ワークスペース/プロジェクトが指定されていない場合は、現在のディレクトリから自動検出されます。このコマンドは、xcodebuild archive に続いて、自動生成された ExportOptions plist を使用して xcodebuild -exportArchive を実行します。
アーカイブ+エクスポート+アップロード(1 つのコマンド)
# Get the next build number automatically
BUILD_NUMBER=$(asc builds next-number --app-id <APP_ID> --version 1.0.0 --platform ios)
asc builds archive \
--scheme <SCHEME_NAME> \
--upload \
--app-id <APP_ID> \
--version 1.0.0 \
--build-number "$BUILD_NUMBER"
--upload フラグを指定すると、エクスポートされた IPA/PKG が既存の asc builds upload フローに直接渡されます。
App ID の解決
project-context.md を参照してください。ユーザーに確認したり、asc apps list を実行したりする前に、.asc/project.json を確認してください。
一般的なワークフロー
APP_ID=$(cat .asc/project.json 2>/dev/null | jq -r '.appId // empty')
# If empty: ask user or run `asc apps list | jq -r '.data[0].id'`
# 1. Get the next build number
BUILD_NUMBER=$(asc builds next-number --app-id "$APP_ID" --version 1.2.0 --platform ios)
# 2. Archive, export, and upload in one command
asc builds archive --scheme MyApp --upload \
--app-id "$APP_ID" --version 1.2.0 --build-number "$BUILD_NUMBER"
# 3. Get the processed build ID
BUILD_ID=$(asc builds list --app-id $APP_ID | jq -r '.data[0].id')
# 4. Distribute to TestFlight beta group
asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID
# 5. Set TestFlight notes
asc builds update-beta-notes --build-id $BUILD_ID --locale en-US --notes "New features"
# 6. Link to version and submit for review
asc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID
asc versions submit --version-id $VERSION_ID
アーカイブのみ(アップロードなし)
# Archive and export to default .build/export/
asc builds archive --scheme MyApp
# The output includes an affordance for the next step:
# "upload": "asc builds upload --file .build/export/MyApp.ipa"
# Ad-hoc distribution
asc builds archive --scheme MyApp --export-method ad-hoc --output-dir dist/
# Manual signing with team ID
asc builds archive --scheme MyApp --signing-style manual --team-id ABCD1234
# macOS app
asc builds archive --scheme MyMacApp --platform macos
エクスポート方法
| 方法 | 用途 |
|---|---|
app-store-connect | App Store/TestFlight での配信(デフォルト) |
ad-hoc | 登録済みデバイスへの直接配信 |
development | 登録済みデバイスでの開発テスト |
enterprise | 社内向けエンタープライズ配信 |
署名オプション
| フラグ | デフォルト | 説明 |
|---|---|---|
--signing-style | automatic | automatic では Xcode がプロファイルを管理します。manual では、事前設定済みのプロファイルが必要です |
--team-id | (なし) | Apple Developer チーム ID。複数のチームが設定されている場合に便利です |
--signing-style automatic(デフォルト)の場合、エクスポートの手順で -allowProvisioningUpdates が xcodebuild に渡され、プロファイルが自動的に解決されます。
CAEOAS のアフォーダンス
アーカイブのみの応答には、エクスポートされたバイナリを指す upload アフォーダンスが含まれます。
{
"data": [{
"ipaPath": ".build/export/MyApp.ipa",
"exportPath": ".build/export",
"affordances": {
"upload": "asc builds upload --file .build/export/MyApp.ipa"
}
}]
}
--upload を使用すると、応答は checkStatus および listBuilds アフォーダンスを含む標準のビルドアップロード形式になります。
トラブルシューティング
| エラー | 原因 | 解決方法 |
|---|---|---|
| "Unknown platform: watchos" | プラットフォーム引数が無効です | ios、macos、tvos、visionos を使用してください |
| "Scheme not found" | スキームが存在しないか、ワークスペースが検出されていません | --workspace または --project を明示的に指定してください |
| "no signing identity found" | コード署名が設定されていません | Xcode で署名を設定するか、--export-method development を指定してください |
| "No profiles for 'X' were found" | プロビジョニングプロファイルがありません | デフォルトの --signing-style automatic で解決されます。または --team-id を明示的に指定してください |
| "app-store" is deprecated | 古いエクスポート方法名です | app-store-connect を使用してください(現在はデフォルトです) |
| "No .ipa or .pkg found" | エクスポートは成功しましたが、バイナリが生成されませんでした | xcodebuild の出力を確認し、スキームがアプリターゲットをビルドすることを確認してください |
| "--app-id is required" | --app-id を指定せずに --upload を使用しています | --app-id を指定するか、先に asc init を実行してください |
リファレンス
以下については、workflow.md を参照してください。
- ワークスペース/プロジェクトの自動検出ロジック
- ExportOptions plist の生成に関する詳細
- プラットフォームと配信先の対応付け
- アーカイブをアップロードフローにつなげる方法