アーカイブ・配布支援。App Store Connect、TestFlight、Ad Hoc/Enterprise配布。 使用タイミング: (1) App Storeへの提出準備時、(2) TestFlight配布時、 (3) Ad Hoc/Enterprise配布時、(4) CI/CDでの自動配布設定時
Guides iOS app archiving and distribution to App Store, TestFlight, Ad Hoc, or Enterprise. Used when preparing App Store submissions, distributing beta builds via TestFlight, creating Ad Hoc/Enterprise IPAs, or setting up CI/CD automation.
/plugin marketplace add CAPHTECH/claude-marketplace/plugin install apple-platform-plugin@caphtech-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/app-store-connect-guide.mdreferences/distribution-guide.mdreferences/export-options.mdreferences/testflight-guide.mdreferences/xcode-cloud-guide.mdiOSアプリのアーカイブ作成から各種配布方法までをガイドする。
| 方法 | 用途 | 証明書 | プロビジョニング |
|---|---|---|---|
| App Store | 一般公開 | Distribution | App Store |
| TestFlight | ベータテスト | Distribution | App Store |
| Ad Hoc | 限定配布(100台) | Distribution | Ad Hoc |
| Enterprise | 社内配布 | Enterprise | In-House |
| Development | 開発・デバッグ | Development | Development |
スキーム設定確認
アーカイブ実行
# 基本的なアーカイブ
xcodebuild archive \
-project MyApp.xcodeproj \
-scheme MyApp \
-archivePath ./build/MyApp.xcarchive
# ワークスペースの場合
xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-archivePath ./build/MyApp.xcarchive \
-destination 'generic/platform=iOS'
# 設定を指定
xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-configuration Release \
-archivePath ./build/MyApp.xcarchive \
CODE_SIGN_STYLE=Manual \
DEVELOPMENT_TEAM=XXXXXXXXXX \
PROVISIONING_PROFILE_SPECIFIER="MyApp Distribution"
<?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>
<!-- App Store配布 -->
<key>method</key>
<string>app-store</string>
<!-- または TestFlight -->
<!-- <string>app-store</string> -->
<!-- Ad Hoc配布 -->
<!-- <string>ad-hoc</string> -->
<!-- Enterprise配布 -->
<!-- <string>enterprise</string> -->
<!-- Development -->
<!-- <string>development</string> -->
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadSymbols</key>
<true/>
<key>uploadBitcode</key>
<false/>
<!-- 署名設定 -->
<key>signingStyle</key>
<string>manual</string>
<key>provisioningProfiles</key>
<dict>
<key>com.example.myapp</key>
<string>MyApp Distribution Profile</string>
</dict>
</dict>
</plist>
# IPAのエクスポート
xcodebuild -exportArchive \
-archivePath ./build/MyApp.xcarchive \
-exportPath ./build/export \
-exportOptionsPlist ExportOptions.plist
1. Window > Organizer を開く
2. アーカイブを選択
3. Distribute App をクリック
4. App Store Connect を選択
5. Upload を選択
6. 指示に従って完了
# 検証
xcrun altool --validate-app \
-f MyApp.ipa \
-t ios \
--apiKey YOUR_API_KEY \
--apiIssuer YOUR_ISSUER_ID
# アップロード
xcrun altool --upload-app \
-f MyApp.ipa \
-t ios \
--apiKey YOUR_API_KEY \
--apiIssuer YOUR_ISSUER_ID
# App Store Connect APIキーを使用
xcrun notarytool submit MyApp.ipa \
--key AuthKey_XXXXXXXXXX.p8 \
--key-id XXXXXXXXXX \
--issuer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX \
--wait
# バージョン番号更新(CFBundleShortVersionString)
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString 1.2.0" Info.plist
# ビルド番号更新(CFBundleVersion)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion 42" Info.plist
# agvtoolを使用(推奨)
# バージョン設定
agvtool new-marketing-version 1.2.0
# ビルド番号インクリメント
agvtool next-version -all
# 特定のビルド番号を設定
agvtool new-version -all 42
What to Test:
- New feature: Dark mode support
- Bug fix: Login screen crash on iOS 15
Known Issues:
- Settings page may show placeholder text
- Push notifications not working in simulator
# デバイスのUDID取得
system_profiler SPUSBDataType | grep -A 11 "iPhone\|iPad"
# または Finder/iTunes で確認
<?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>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://example.com/apps/MyApp.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>url</key>
<string>https://example.com/apps/icon-57.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>url</key>
<string>https://example.com/apps/icon-512.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.example.myapp</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>My App</string>
</dict>
</dict>
</array>
</dict>
</plist>
<a href="itms-services://?action=download-manifest&url=https://example.com/apps/manifest.plist">
Install App
</a>
name: Build and Deploy
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.2.app
- name: Install certificates
env:
CERTIFICATE_BASE64: ${{ secrets.CERTIFICATE_BASE64 }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# キーチェーン作成
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# 証明書インポート
echo "$CERTIFICATE_BASE64" | base64 --decode > certificate.p12
security import certificate.p12 -k build.keychain \
-P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: \
-s -k "$KEYCHAIN_PASSWORD" build.keychain
- name: Install provisioning profile
env:
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
run: |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
echo "$PROVISIONING_PROFILE_BASE64" | base64 --decode \
> ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision
- name: Build and archive
run: |
xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-archivePath ./build/MyApp.xcarchive \
-destination 'generic/platform=iOS'
- name: Export IPA
run: |
xcodebuild -exportArchive \
-archivePath ./build/MyApp.xcarchive \
-exportPath ./build/export \
-exportOptionsPlist ExportOptions.plist
- name: Upload to App Store Connect
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
run: |
echo "$APP_STORE_CONNECT_API_KEY" > AuthKey.p8
xcrun altool --upload-app \
-f ./build/export/MyApp.ipa \
-t ios \
--apiKey $APP_STORE_CONNECT_KEY_ID \
--apiIssuer $APP_STORE_CONNECT_ISSUER_ID
# Fastfile
default_platform(:ios)
platform :ios do
desc "Upload to TestFlight"
lane :beta do
build_app(
workspace: "MyApp.xcworkspace",
scheme: "MyApp",
export_method: "app-store"
)
upload_to_testflight(
skip_waiting_for_build_processing: true
)
end
desc "Release to App Store"
lane :release do
build_app(
workspace: "MyApp.xcworkspace",
scheme: "MyApp",
export_method: "app-store"
)
upload_to_app_store(
skip_screenshots: true,
skip_metadata: true
)
end
end
| エラー | 原因 | 解決策 |
|---|---|---|
| Invalid Signature | 署名の不一致 | Provisioning Profileを再確認 |
| Missing Compliance | 暗号化申告未設定 | Info.plistに ITSAppUsesNonExemptEncryption を追加 |
| Invalid Binary | アーキテクチャ問題 | シミュレータ用コードの除外を確認 |
| Bundle ID Mismatch | Bundle ID不一致 | プロジェクト設定とプロファイルを確認 |
# IPAの内容確認
unzip -l MyApp.ipa
# 署名情報確認
codesign -dv --verbose=4 MyApp.app
# Provisioning Profile確認
security cms -D -i embedded.mobileprovision
# App Store Connect API接続テスト
xcrun altool --list-apps \
--apiKey YOUR_API_KEY \
--apiIssuer YOUR_ISSUER_ID
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.