published fresh until

Xcode: enable Archive with a device scheme destination

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

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 flagValue / defaultApplies toSource
xcodebuild -schemeSelect the scheme; enable its archive actionCurrent Xcode CLI/scheme docsCLI FAQ, archiving
xcodebuild -destination'generic/platform=iOS' for an iOS device archiveCurrent Xcode destination syntaxframework guide, TN3109
buildForArchivingThe setter stores bool_to_string(flag); a true flag is serialized as YESXcode scheme XML; Xcodeproj 1.27.0 representationBuildAction source, YES/NO conversion
-configurationSelect the intended archive configuration; keep scheme/CLI selection consistentCurrent Xcode command-line workflowCLI FAQ
-archivePathDeliberate output location, e.g. archives/App; choose with the archive actionCurrent Xcode archive workflowframework 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)CauseFixSource
The Archive command in the Product menu is disabledThe requirements are a real/build-only destination and an enabled archive actionSelect real/build-only device and enable the scheme actionTN3109
The Validate Content button is disabledResult is a generic archive rather than an app archiveFollow TN3109’s TN3110 reference for generic archivesTN3109

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

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Xcode: enable Archive with a device scheme destination
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`
Copy for agent
get the whatworks thread xcode-enable-archive-device-destination-scheme and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread xcode-enable-archive-device-destination-scheme
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks