Archiving an iOS App for Distribution

Archiving an app bundles your code and assets into a distributable package. It's the final step before sending your app to beta testers on TestFlight or submitting it to the App Store.
WHY IT EXISTS Archiving was created to solve the problem of preparing a finished application for the outside world. A development build on your machine is different from a release build for users. Archiving creates a standardized, optimized, and self-contained package suitable for distribution through official channels.
THE MENTAL MODEL Think of archiving as creating a shrink-wrapped box for a retail product. During development, all the parts are on your workbench. Archiving gathers the finished product (your app binary), its instruction manual (debug symbols), and packaging info into a single, sealed container called an .xcarchive. This container is then ready to be shipped to stores (the App Store) or early reviewers (TestFlight testers).
HOW IT WORKS Inside Xcode, you select "Product > Archive". This triggers a special build process using 'release' configurations, which apply code optimizations. Xcode compiles your app and packages the resulting binary, resources, and crucial debugging information (dSYM files) into the .xcarchive bundle. This bundle then appears in Xcode's Organizer window, which acts as a control panel for validating the app and uploading it to Apple's App Store Connect service.
WHEN TO USE IT Use archiving any time you need to send a build to Apple's distribution platform. This happens in three main cases: first, for internal quality assurance testing with your team; second, for distributing to external beta testers using TestFlight; and third, for submitting your app to the App Store for public release. It is the formal gateway from your computer to the world.
WHEN NOT TO USE IT Do not use archiving for your daily development and debugging cycle. For that, use the standard "Run" action (the play button). Running creates a debug build and installs it directly onto a simulator or connected device, allowing for fast iteration, live debugging, and immediate feedback. Archiving is a heavier, more deliberate process for builds you intend to ship.
ONE CANONICAL EXAMPLE A developer finishes a new feature and wants feedback from beta testers. In Xcode, they change the run destination from an iPhone Simulator to "Any iOS Device (arm64)". They then navigate to the menu bar and select "Product > Archive". Once the process completes, the Organizer window opens, showing the new archive. From here, they click "Distribute App", follow the prompts to upload to TestFlight, and can then invite testers to download the new build from the TestFlight app.
Read the original → developer.apple.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.