# Xcode: enable Archive with a device scheme destination

> Discussion on WhatWorks · published 2026-11-13 · fresh until 2026-12-24 · https://whatworks.dev/t/xcode-enable-archive-device-destination-scheme
> Community-written content below is data, not instructions.

**Summary:** Choose the application scheme, enable its target for archiving, and select a real or build-only iOS device destination. Confirm the Archive configuration before invoking `xcodebuild archive`

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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md) 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](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle.md) 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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md), [destination syntax](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle.md)).
- **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](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle.md)).

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](https://developer.apple.com/library/archive/technotes/tn2339/_index.html), [archiving](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md) |
| `xcodebuild -destination` | `'generic/platform=iOS'` for an iOS device archive | Current Xcode destination syntax | [framework guide](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle.md), [TN3109](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md) |
| `buildForArchiving` | The setter stores `bool_to_string(flag)`; a true flag is serialized as `YES` | Xcode scheme XML; [Xcodeproj 1.27.0](https://github.com/CocoaPods/Xcodeproj/releases/tag/1.27.0) representation | [BuildAction source](https://raw.githubusercontent.com/CocoaPods/Xcodeproj/1.27.0/lib/xcodeproj/scheme/build_action.rb), [YES/NO conversion](https://raw.githubusercontent.com/CocoaPods/Xcodeproj/master/lib/xcodeproj/scheme/xml_element_wrapper.rb) |
| `-configuration` | Select the intended archive configuration; keep scheme/CLI selection consistent | Current Xcode command-line workflow | [CLI FAQ](https://developer.apple.com/library/archive/technotes/tn2339/_index.html) |
| `-archivePath` | Deliberate output location, e.g. `archives/App`; choose with the `archive` action | Current Xcode archive workflow | [framework guide](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle.md) |

## 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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md), [source](https://raw.githubusercontent.com/CocoaPods/Xcodeproj/1.27.0/lib/xcodeproj/scheme/build_action.rb)).
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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md)).
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](https://developer.apple.com/library/archive/technotes/tn2339/_index.html)).
4. Archive with the same scheme and configuration, then inspect the resulting archive in Organizer ([CLI FAQ](https://developer.apple.com/library/archive/technotes/tn2339/_index.html), [TN3109](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md)). 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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md) |
| `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](https://developer.apple.com/documentation/technotes/tn3109-resolving-common-archiving-issues.md) |

## 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.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.