What this thread does
Do first: select the app scheme and a real or build-only iOS device destination, then enable the archive action for the scheme building your app.
Short answer
The Archive command in the Product menu is disabled is a scheme/destination diagnostic. As of November 2026, current Apple TN3109 still lists two requirements for enabling Product > Archive: a real/build-only device destination and an archive-enabled scheme. A simulator run destination cannot produce an app archive for App Store submission. For unattended iOS device builds use -destination "generic/platform=iOS"; Apple's binary-framework guide documents that exact destination syntax.
Choose / don't choose
- Generic device: choose
-destination "generic/platform=iOS"for a generic device destination; don't select iOS Simulator for an app distribution archive (TN3109, destination syntax). - Specific device: choose when you intentionally need that connected device destination; don't make ordinary archive automation depend on a developer's phone being attached.
- Simulator framework archive: a separate framework-packaging workflow can archive simulator variants. Don't confuse that XCFramework operation with creating a distributable app archive (framework guide).
Not for: privacy metadata inside an existing archive; see apple-privacy-manifest-release-archive-primary-sources.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
xcodebuild -scheme | Select the scheme; enable its archive action | Current Xcode CLI/scheme docs | CLI FAQ, archiving |
xcodebuild -destination | 'generic/platform=iOS' for an iOS device archive | Current Xcode destination syntax | framework guide, TN3109 |
buildForArchiving | The setter stores bool_to_string(flag); a true flag is serialized as YES | Xcode scheme XML; Xcodeproj 1.27.0 representation | BuildAction source, YES/NO conversion |
-configuration | Select the intended archive configuration; keep scheme/CLI selection consistent | Current Xcode command-line workflow | CLI FAQ |
-archivePath | Deliberate output location, e.g. archives/App; choose with the archive action | Current Xcode archive workflow | framework guide |
Order of operations
1. Open the actual project/workspace and select the app scheme. Enable the archive action for the scheme building your app (archiving, source). 2. Choose a real or build-only iOS device destination in the toolbar. If Archive is gray, check this before investigating signing profiles; TN3109 documents a real/build-only device destination and an enabled archive action (TN3109). 3. Select the intended configuration for the Archive action. Ensure command-line automation selects the same scheme/configuration. Use -workspace to specify the workspace (CLI FAQ). 4. Archive with the same scheme and configuration, then inspect the resulting archive in Organizer (CLI FAQ, TN3109). The linked source does not confirm: the exact command-line destination and archive-path flags, and whether enabling the action establishes signing validity.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
The Archive command in the Product menu is disabled | The requirements are a real/build-only destination and an enabled archive action | Select real/build-only device and enable the scheme action | TN3109 |
The Validate Content button is disabled | Result is a generic archive rather than an app archive | Follow TN3109’s TN3110 reference for generic archives | TN3109 |
Missing
- App signing, export method and generic-archive packaging are separate follow-up diagnostics. No certificate/profile repair is implied by enabling the menu item.
Checked
2026-11-12; current Apple archive/scheme/framework/CLI references, TN3109 revision dated May 24, 2022, Xcodeproj 1.27.0 release and BuildAction source plus XML boolean conversion read. No Xcode archive executed.
Started from a post by @Apple, packaged by the editor. Original post