Zilmac Blog
← Back to Tech Practice

Claude Code iOS Project Won't Archive? Gray Xcode Archive Button, Code Signing, and IPA Export

iOS packaging ·About 8 min read

A MacBook on the desk, facing the person checking the Xcode run destination while Archive is still disabled

You already restarted Xcode and chose Clean Build Folder. Archive in the Product menu is still gray. Claude Code finished the Swift files and the project, and ⌘B compiles. The button stays gray because the run destination is still a simulator, or this scheme has no Archive action. Signing errors show up only after the button turns on.

2 checks
Destination first, then the scheme
1 file
A shared scheme is what Git keeps
0 certs
Do not reinstall certificates while the button is gray

Set the run destination to Any iOS Device

The destination under the toolbar is probably an iPhone simulator. Archive is offered only for a generic device destination. Apple's distribution guide treats Archive as the step that produces a build for release, and that step does not target a simulator.

  1. Click the run destination at the top of the Xcode window.
  2. Choose Any iOS Device (arm64). A physical iPhone is optional. Do not pick a simulator.
  3. Open the Product menu again. If Archive is no longer gray, this step is done.
One judgment

A gray button is a destination or scheme problem. Certificates join in only after Archive actually runs.

Confirm Archive is checked and the scheme is shared

A developer at a laptop checking whether the scheme includes an App target that can be archived
If Claude Code saved the scheme only in the local user folder, Archive stays gray when another Mac opens the project.

Use Product → Scheme → Manage Schemes. The current scheme needs both of these: Archive is checked under Edit, and Shared is checked in the list on the left.

A scheme Claude Code created on one Mac may land in xcuserdata. That folder usually stays out of Git. Copy the project to the Mac that exports the build and the App scheme is missing, so the Product menu has nothing to archive. After you check Shared, the file appears under xcshareddata/xcschemes. Commit that file and pull it on the packaging Mac.

If the list has only a test target or a Swift package, and no iOS App target, Archive stays gray. Point the scheme's Archive action at the .app target.

Check the same thing from the command line

Once the button enables, you can archive with the same destination the menu uses. Write a generic iOS device destination, not a simulator name.

Same as Product → Archive
xcodebuild -scheme YourApp -showdestinations
xcodebuild archive \
  -scheme YourApp \
  -configuration Release \
  -destination 'generic/platform=iOS' \
  -archivePath build/YourApp.xcarchive

If -showdestinations cannot see this scheme, the shared scheme was not committed. “scheme not found” and a gray menu item are the same problem.

If it is still gray, match the symptom

What you seeChange this first
The destination says iPhone 16 SimulatorSwitch to Any iOS Device (arm64)
Manage Schemes has no App nameOn the Mac that still has the full project, check Shared and commit
The scheme's Archive row is emptyPoint Archive at the App target, not the test target
The button is clickable and export then fails signingStop changing the destination. Inspect the keychain on the packaging Mac

For a single package, aligning the destination and the scheme is enough. If you ship every week, keep the shared scheme in the repo so you do not rebuild it on every machine.

Shortest path

  1. Set the run destination to Any iOS Device (arm64).
  2. In Manage Schemes, point Archive at the App and check Shared.
  3. Commit xcshareddata/xcschemes and pull on the packaging Mac.
  4. Choose Product → Archive. Deal with signing only after the button is clickable.

Next step

Compile and sign on the same Mac that has Xcode. If the button works and export still fails, finish the handoff in this article:

Claude Code on Windows for iOS: which Mac runs the build and signing

Sources

FAQ

Why is Archive gray when a simulator is selected?

Archive is available only for a generic iOS device destination. If the run destination is a simulator or My Mac, Archive stays gray in the Product menu. Switch to Any iOS Device (arm64) and look again.

Does a signing mismatch gray out the Archive button?

Usually no. Certificate and profile errors appear after the button is clickable and Archive has started. If the button itself is gray, check the destination and the scheme before reinstalling certificates.

Why can't another Mac see a scheme Claude Code just created?

A scheme that lives only under xcuserdata is not in Git. In Manage Schemes, check Shared so the file is written to xcshareddata/xcschemes, then commit it.

The button works but export fails. Which article is next?

Read which Mac runs the build and the signing. Archive has to run on the Mac that has Xcode and the private key in its keychain.

Build and signing

Once the button works, sign on the same Mac

After Archive is clickable, the export still belongs on the Mac that has Xcode.

See which Mac builds and signs
Next Build and signing