/apple-dev-skills:local-archive-export-uploadfrom apple-dev-skills
Manually archives, exports, and uploads iOS builds to TestFlight when Xcode Cloud is unavailable. Covers xcodebuild archive/exportArchive, ExportOptions.plist configuration, and altool upload with API key auth.
Ships in apple-dev-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The manual escape hatch for getting a build to TestFlight when Xcode Cloud's
Main CI workflow (→ xcode-cloud-single-track-ci) can't run — quota
exhausted, an outage, or CI not wired up yet. Same three Apple CLIs Xcode
Cloud uses under the hood — xcodebuild archive, -exportArchive, upload —
driven by hand instead of Apple's managed runner.
ExportOptions.plist / signing / build-number failure.-exportOptionsPlist need".Owns: the local three-step pipeline (archive → export → upload) and its signing/export-key semantics. Does NOT own:
asc-api-automation.app-store-review-rejections..p8 / API-key storage → build-time-secret-injection +
apple-public-repo-security.| Step | Command | Notes |
|---|---|---|
| 1. Archive | xcodebuild archive -scheme <Scheme> -destination 'generic/platform=iOS' -archivePath build/App.xcarchive | -destination picks the platform; a generic/platform=... destination (not a specific simulator/device) is what produces an archivable, distributable build. |
| 2. Export | xcodebuild -exportArchive -archivePath build/App.xcarchive -exportPath build/export -exportOptionsPlist ExportOptions.plist | Requires -archivePath + -exportOptionsPlist; -exportPath only needed when the plist's destination is export (see below). |
| 3. Upload | xcrun altool --upload-package build/export/App.ipa --api-key <keyID> --api-issuer <issuerID> --wait | --api-key / --api-issuer are the spelling altool --help's own example uses; add --wait to block until Apple finishes processing instead of polling separately. Or fold into step 2 — see "One-step vs two-step" below. |
xcodebuild -help documents two credential sources for -allowProvisioningUpdates:
an account added in Xcode's Accounts settings, or an App Store Connect authentication
key passed via the -authenticationKey* trio. Both paths below therefore pass the flag
(needed on a script/cron path, not just CI):
| Path | Flags | Use when |
|---|---|---|
| Automatic signing via your Xcode account | -allowProvisioningUpdates (+ -allowProvisioningDeviceRegistration if a new device needs registering) | Run on your own dev Mac with an account added in Xcode's Accounts settings; xcodebuild creates/updates profiles and certs as needed. |
| API-key signing, no Apple ID session | -allowProvisioningUpdates -authenticationKeyPath <p8> -authenticationKeyID <id> -authenticationKeyIssuerID <issuer> | Unattended/scripted runs — reuse the same ASC API key from asc-api-automation / build-time-secret-injection, no Xcode account needed. |
Two signing failures that look like credential problems but are keychain state (observed on one machine, 2026-10, Xcode version not recorded; not found in Apple's docs):
-exportArchive was seen to use cloud-managed distribution signing only when no Apple Distribution certificate was in the keychain search list; a stale local one silently took over. Check security find-identity -v -p codesigning before blaming the key or profile.errSecInternalComponent while signing came from a locked login keychain, not lost keys: security show-keychain-info ~/Library/Keychains/login.keychain-db answers "Unable to obtain authorization". Unlock it (security unlock-keychain) in the unattended job before xcodebuild.The full key set is printed by xcodebuild -help under "Available keys for
-exportOptionsPlist" (18 keys on Xcode 26.5, covering thinning, manifests, on-demand
resources). For a plain "ship to TestFlight" export, six keys are load-bearing
(cross-checked against the key list in xcodebuild -help):
<key>destination</key> <string>export</string> <!-- or "upload" -->
<key>method</key> <string>app-store-connect</string>
<key>manageAppVersionAndBuildNumber</key> <false/>
<key>signingStyle</key> <string>automatic</string>
<key>teamID</key> <string>ABCDE12345</string>
<key>uploadSymbols</key> <true/>
method: app-store-connect — the current name; app-store still works
but Xcode 26.5's xcodebuild -help already marks it "deprecated: use
app-store-connect" (the exact Xcode version the rename landed in is
unconfirmed).manageAppVersionAndBuildNumber: false — defaults to YES (Xcode bumps
the build number for you on export); set false when your own tooling
controls CFBundleVersion — see build-number coordination below.teamID — omit to inherit the archive's signing team; set explicitly
when a machine/CI identity could resolve ambiguously.destination | Artifact | Gate before upload | Use when |
|---|---|---|---|
export | .ipa/.pkg written to -exportPath | Your own --dry-run/--i-am-sure-style flag on a separate upload command | Default |
upload | None — xcodebuild uploads directly to Apple, no local artifact, no separate altool call | None — the network push happens the instant -exportArchive runs | Deliberate one-shot only |
Prefer destination: export + a separate, deliberately-gated upload command
so archive/export stay safe to run freely and only upload needs a human's
explicit go-ahead.
xcrun altool --help (Xcode 26.5) lists --upload-package <file> first among
App-Upload commands and uses it in its own canonical example; the older
--upload-app -f <file> still works but isn't the tool's own example anymore.
altool searches fixed directories for AuthKey_<keyID>.p8 (./private_keys,
~/private_keys, ~/.private_keys, ~/.appstoreconnect/private_keys, or
$API_PRIVATE_KEYS_DIR) — stage a per-run symlink into one of these if your
key lives in a gitignored secrets/ dir, rather than moving the real file.
notarytool is not this path — it handles Developer-ID notarization
(outside-the-App-Store distribution), unrelated to TestFlight/App Store
uploads. The ASC API's Build Uploads path also works (see
references/official-docs.md), but this skill still defaults to altool.
For the other upload paths (Xcode Cloud, Xcode Organizer, Transporter), read
references/official-docs.md.
Per xcode-cloud-single-track-ci, Xcode Cloud assigns its own sequential
CI_BUILD_NUMBER per build, independent of whatever's in the repo. A local
build needs a CFBundleVersion that will never collide with — or fall below —
that counter:
YYYYMMDDHHmm) rather than a small
hand-incremented integer — it can't collide with Xcode Cloud's small
sequential counter, and TestFlight rejects a duplicate CFBundleVersion for
the same CFBundleShortVersionString.xcode-cloud-single-track-ci
documents for its "existing Mac app" exception.manageAppVersionAndBuildNumber: false (above) so Xcode's export-time
bump doesn't fight your chosen number.Every flag and key here is verifiable straight from Apple's own CLI (man xcodebuild, xcodebuild -help, xcrun altool --help) — no fastlane, no
third-party packaging tool, consistent with this catalog's no-Homebrew /
Apple-native-first baseline (asc-api-automation makes the same call for ASC
REST automation). Provenance for each claim (doc-verified vs practice-observed)
is in references/evidence.md.
xcode-cloud-single-track-ci's
single-track rule).touching ExportOptions.plist before writing it with PlistBuddy.destination: upload as the default — loses the archive-only dry run.method: app-store (deprecated form) in an old plist.CFBundleVersion locally — collides with Xcode
Cloud's own counter.xcrun notarytool for a TestFlight upload — it's for
Developer-ID notarization, a different distribution path entirely.ITSAppUsesNonExemptEncryption on a new app — the build is
marked Missing Compliance until the export-compliance questions are answered
in ASC or via PATCH /v1/builds/{id} (usesNonExemptEncryption).generic/platform=... destination, not a specific
simulator/device.method: app-store-connect (not the deprecated app-store).-allowProvisioningUpdates on every path, with a
deliberate credential source: the Xcode Accounts login (your dev Mac) or
the -authenticationKeyPath trio (unattended).destination: export + a separate gated upload step, unless a one-step
upload is a deliberate choice.CFBundleVersion source can't collide with Xcode Cloud's CI_BUILD_NUMBER.ITSAppUsesNonExemptEncryption set in Info.plist (or export-compliance
is otherwise answered)..p8 staged only via a per-run symlink into an altool-searched
directory, never committed or left behind after the run.xcode-cloud-single-track-ci — the primary CI path this substitutes for;
restore it once quota/outage clears.asc-api-automation — TestFlight/App Store operations once the build lands in ASC.app-store-review-rejections — its export-compliance row (an ASC upload
step, not a Guideline number) and what has to be true for review to pass.apple-skills:guide-macos-spm-packaging (aggregated external) — Developer-ID
signing / notarytool notarization for outside-the-App-Store distribution.build-time-secret-injection / apple-public-repo-security — where the
.p8 and its issuer/key IDs live and how leaks are prevented.storekit2-iap-defaults — this pipeline is how a build carrying that
skill's IAP code reaches TestFlight.references/official-docs.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub wei18/apple-dev-skills --plugin apple-dev-skills28 skills in this plugin
/ai-translated-localizationLocalization scope and AI-translation execution for Apple-platform Apps on `Localizable.xcstrings` — default locale set, source / primary language rule, per-locale review gotchas, completeness gates. Use when deciding which locales to ship at project setup; when adding or refreshing user-facing strings (UI keys, Game Center, App Store metadata) in non-source locales; when `extractionState: stale` entries or untranslated placeholder markers appear; or when asked "how many locales", "how do translations enter git". Does NOT cover RTL layout or ASC upload mechanics → asc-api-automation./apple-platform-targetsDefault minimum deployment target for Apple-platform Swift Apps — iOS 26 / macOS 26 on the Xcode 26 toolchain (Swift 6 language mode) — and how to deviate down (iOS 18 / 17) or up. Use when starting a new Apple-platform project, writing the Package.swift `platforms:` list, deciding whether an API newer than the floor is worth bumping for or a client requirement forces dropping below it, or when asked "what should the minimum iOS / macOS version be". Entry point of the bootstrap chain; does NOT own language mode → swift6-concurrency, or module layout → swiftpm-modularization./apple-public-repo-securityUse when a repo goes public or open-sources, when a CloudKit server-to-server PEM, ASC API `.p8`, APNs key, signing `.p12`, or provisioning profile first enters the pipeline, or when asked how to prevent or respond to a secret leak (gitleaks, lefthook, GitHub Secret Scanning, `git filter-repo`, rotate-first). Also for Apple upstream telemetry disclosure (MetricKit, Game Center, sysdiagnose). Repo-hygiene baseline only; ship-in-binary identifiers (AdMob IDs via xcconfig) and CLI keys in `secrets/.env` are build-time-secret-injection; ASC API usage is asc-api-automation./apple-three-piece-analyticsChoose analytics and metrics sources for a solo / small-team Apple app and decide whether a third-party tracking SDK is justified. Use when picking an analytics SDK; when asked "should I add Firebase / Mixpanel / Amplitude / TelemetryDeck"; when asked what App Store Connect Analytics, MetricKit (`MXMetricPayload`) or Game Center can measure without an SDK; when the analytics choice drives `PrivacyInfo.xcprivacy` or forces ATT. Does NOT own MetricKit perf wiring (ios-performance-engineering), App Review privacy-label parity (app-store-review-rejections), or sink code (telemetry-facade-pattern)./app-store-review-rejectionsUse when preparing an App Store submission, reading an App Review rejection or Resolution Center message citing a guideline number (2.1, 2.3.x, 3.1.1, 4.3, 5.1.1, 5.1.2), or a privacy-manifest upload email (ITMS-91061 / ITMS-91056, missing required-reason API), or auditing an ads + Remove-Ads IAP + CloudKit + Game Center app for the rejection classes it realistically hits: the ATT-vs-AdMob trap, privacy-label parity with `PrivacyInfo.xcprivacy`, Restore Purchases, screenshot metadata, export compliance. Maps each class to a pre-submit fix. Not the submission mechanics (asc-api-automation) nor StoreKit implementation (storekit2-iap-defaults)./asc-api-automationUse when automating App Store Connect from a script or CI via the ASC REST API (`api.appstoreconnect.apple.com`) — ASC API `.p8` key / JWT auth, TestFlight `betaGroups` / `betaBuildLocalizations`, `appStoreVersions` / `releaseType`, `reviewSubmissions`, `salesReports`, `analyticsReportRequests` — or asked "automate TestFlight / submission / release notes", "should I use fastlane", or debugging 401 NOT_AUTHORIZED / 429 RATE_LIMIT_EXCEEDED, or asked which ASC steps have no API and must be clicked by hand. API side only: build & upload → xcode-cloud-single-track-ci / local-archive-export-upload; `.p8` storage → build-time-secret-injection.Other plugins' skills for the same job