What is inside an .xcarchive and an .ipa, what does exportArchive add, and what does it need to succeed?

25.7.1 · L3 · Interview

Predict first

An unsigned release archive is inspected, exported and zipped. What does each step report?

// === run.sh ===
cp -R "$FIXTURE"/. .
xcodebuild archive -project Demo.xcodeproj -scheme Demo -sdk iphoneos -configuration Release \
  -archivePath out/Demo.xcarchive CODE_SIGNING_ALLOWED=NO -quiet >/dev/null 2>&1
echo "archive: $(ls out/Demo.xcarchive | tr '\n' ' ')"
echo "app: $(ls out/Demo.xcarchive/Products/Applications) dSYM: $(ls out/Demo.xcarchive/dSYMs)"
P=out/Demo.xcarchive/Info.plist
echo "archive plist: $(plutil -extract ApplicationProperties.CFBundleIdentifier raw $P) $(plutil -extract ApplicationProperties.CFBundleShortVersionString raw $P) ($(plutil -extract ApplicationProperties.CFBundleVersion raw $P))"
echo "signing identity: [$(plutil -extract ApplicationProperties.SigningIdentity raw $P)] team: [$(plutil -extract ApplicationProperties.Team raw $P)]"
codesign -dv out/Demo.xcarchive/Products/Applications/Demo.app 2>&1 | tail -1
printf '<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>method</key><string>app-store-connect</string></dict></plist>' > ExportOptions.plist
xcodebuild -exportArchive -archivePath out/Demo.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath exp 2>&1 | grep -E "^error:|EXPORT"
mkdir Payload && cp -R out/Demo.xcarchive/Products/Applications/Demo.app Payload/ && zip -qr Demo.ipa Payload
echo "zip layout: $(unzip -Z1 Demo.ipa | head -2 | tr '\n' ' ')"
  • The archive has an empty signing identity and team, export fails with “No Team Found in Archive”, the zip starts with Payload/
  • Export succeeds with a development profile
  • The archive contains an .ipa

Mental model. The archive is a finished but unsealed shipment on the dock with its packing list; export puts the courier’s seal on it and loads it onto the right truck.

An .xcarchive is a folder: an Info.plist (the app’s bundle ID, versions, architectures, and the signing identity and team that were used), Products/Applications/Demo.app, and dSYMs/ with the debug symbols. In the check, an archive made with CODE_SIGNING_ALLOWED=NO shows an empty signing identity and team, and codesign reports the app is not signed. An .ipa is just a zip with a Payload/<App>.app folder at the top; the check zips one to show the layout (that unsigned zip is not installable). Archiving builds in the Release configuration and produces the symbols; it does not make anything distributable.

xcodebuild -exportArchive is the step that re-signs for a distribution method and packages the result: it needs a team in the archive, a matching distribution certificate and profile (or automatic signing with an API key, Q478, Q480) and an ExportOptions.plist naming the method (in current Xcode, app-store-connect, release-testing, debugging and the like; older names such as app-store and ad-hoc still appear in many scripts). The check shows the honest failure on an unsigned archive: error: exportArchive No Team Found in Archive. This also gives the useful debugging order: if archive fails it is a build problem, if export fails it is a signing problem, and you can keep the archive and retry export without rebuilding, which is how a pipeline promotes one artefact (Q482). Keep the archive and its dSYMs for every shipped build (Q481). A real export was not run because it needs a paid team.

Archive and export are separate; export is where signing inputs are required.

Common traps

  • Re-archiving to fix a signing problem. Archive is not where signing is decided; fix the export inputs and export the same archive again.
  • Discarding the archive after upload. The dSYMs inside it are what you need for crash reports later.

They might follow up with

  • Why does the archive record the signing identity? Export uses it to choose profiles and to warn when the team is missing.
  • Is an .ipa the same as the App Store package? The store re-processes it (thinning, slicing), so the binary users receive differs per device (Q439).

Related questions

  • 25.1.1 How does iOS code signing work: certificates, App IDs, provisioning profiles, signing identities, export…
  • 25.2.1 What are the main ways to run iOS CI/CD (Xcode Cloud, GitHub Actions, Fastlane, others), and what do they all…
  • 25.2.2 How do marketing versions and build numbers work, how should CI generate them, and which rules does App Store…
  • 25.2.3 How do you design a release pipeline: hermetic builds, secrets, caching, artefact promotion and the order of…
  • 21.7.1 What is app thinning, how do on-demand resources and Background Assets reduce install size, and what happened…

How do you inspect the binary you are about to ship: the minimum OS… →