Why this happens
When Product > Archive is greyed out in Xcode, the most common cause is the active run destination. If you have an iOS, watchOS, tvOS, or visionOS Simulator selected in the Xcode toolbar, Xcode disables the Archive menu item.
Simulators run on your Mac’s architecture (or simulator-specific slices) rather than physical device binaries. Because an .xcarchive is meant for App Store Connect, TestFlight, or Ad Hoc distribution on real hardware, Xcode cannot create a distributable archive from a simulator destination.
A secondary misconception is that an expiring or missing provisioning profile disables the Archive button. Even if your Ad Hoc or App Store provisioning profile is about to expire, Xcode still enables Product > Archive as long as a valid device destination and archivable scheme are selected. Provisioning and signing problems only surface during the build phase or later in the Organizer when you click Distribute App.
How to fix it
1. Switch the run destination to Any iOS Device
Changing the destination from a simulator to a generic or physical device immediately re-enables Product > Archive.
- Look at the Xcode toolbar at the top of the window, just to the right of your active scheme name.
- Click the current destination (for example,
iPhone 16 Pro). - In the dropdown list, select Any iOS Device (arm64) (in older Xcode versions, this is labeled Generic iOS Device), or select a physical iPhone or iPad plugged into your Mac.
- Open the Product menu again—Archive will now be clickable.
You can also change this via the menu bar without using the toolbar dropdown: go to Product > Destination > Any iOS Device (arm64).
If you are building for another Apple platform, choose the matching generic destination instead, such as Any macOS Device, Any watchOS Device, or Any tvOS Device.
2. Check your scheme’s Build and Archive configuration
If you already have Any iOS Device (arm64) selected and Archive is still disabled, your active scheme may not have archiving enabled for its target.
- Go to Product > Scheme > Edit Scheme… (or press
Command + <). - Select Build in the left sidebar.
- Locate your main app target in the list and verify that the Archive checkbox is checked.
- Next, select Archive in the left sidebar.
- Confirm Build Configuration is set to
Release(or your custom release configuration) and Reveal Archive in Organizer is checked. - Click Close and check Product > Archive again.
Also check which scheme is currently active in the toolbar. If you accidentally switched to a test target, widget extension, or a third-party dependency scheme (such as a CocoaPods or Swift Package library target), Xcode may disable archiving because that scheme does not produce a standalone app bundle.
3. Verify you opened an app project instead of a Swift Package
If you opened a Package.swift file directly in Xcode, Product > Archive is unavailable because Swift packages compile into libraries or executables without an app bundle or .xcarchive structure.
To archive an app that uses Swift packages:
- Close the standalone package window.
- Open your
.xcodeprojor.xcworkspacefile instead. - Select your app’s scheme and set the destination to Any iOS Device (arm64).
4. Archive from the terminal with xcodebuild
If you want to verify that your project archives cleanly—or you are setting up a CI/CD pipeline—you can bypass the Xcode menu entirely using xcodebuild in Terminal. Passing the generic iOS destination forces an archive build regardless of what is selected in the Xcode GUI.
For a workspace (commonly used with CocoaPods):
xcodebuild archive \
-workspace YourApp.xcworkspace \
-scheme YourAppScheme \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath ./build/YourApp.xcarchive
For a standard .xcodeproj without a workspace, replace -workspace YourApp.xcworkspace with -project YourApp.xcodeproj.
Once the command finishes with ARCHIVE SUCCEEDED, you can double-click YourApp.xcarchive in Finder to open it in Xcode’s Organizer for distribution.
How to prevent it
- Check the toolbar before archiving: Make a habit of glancing at the destination picker next to your scheme before opening the Product menu.
- Keep a dedicated release scheme: If your team tests with multiple schemes, ensure your primary app scheme always has Archive checked under Edit Scheme > Build.
- Automate release builds: Use
xcodebuild archiveor Xcode Cloud for TestFlight and App Store builds so simulator selections during daily debugging never block a release.
FAQ
Does an expiring provisioning profile disable Product > Archive?
No. Even if an Ad Hoc or Distribution provisioning profile is close to expiring, Product > Archive remains enabled as long as a physical or generic device destination is selected. If a profile is invalid or expired, Xcode will show a code signing error during the build or when you try to export the archive in Organizer.
Why is it called “Any iOS Device” instead of “Generic iOS Device”?
Apple renamed Generic iOS Device to Any iOS Device (arm64) in newer versions of Xcode to clarify the target architecture. Both options serve the exact same purpose: building a device-compatible binary without requiring a physical iPhone or iPad to be connected.
Can I archive a Mac app with “My Mac” selected?
Yes. Unlike iOS Simulators, My Mac (or Any Mac) targets real macOS hardware, so Product > Archive remains enabled for macOS app schemes.
Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.
