How do I create a release build in Xcode?
Solution 1
It is done over building an Archive version.
First connect a iOS device to your Mac. Then select that device as target in Xcode.
Now click on the tab "Product" and click on "Archive"
Solution 2
Product / Scheme / Edit Scheme..
And from the menu that comes up, select Release under "Build Configuration".
Solution 3
Xcode 11
I found this question because I had already finished debugging my app and I wanted to make a release build for the app store. I always forget which menu item to use, though. This answer is a reminder to me and others next time.
Choose the Generic iOS Device from the active scheme menu.
Then go to Product > Archive.
You may have to wait a little while for Xcode to finish archiving your project. After that you will be shown a dialog with your archived project. You can select Distribute app... and follow the prompts.
More Help
This answer is for those who are already all signed up with a developer account and just need to get the archive from Xcode to iTunes Connect. If you need more help signing up for a developer account and getting an app to the app store, read the following links.
- How to Submit An App to Apple: From No Account to App Store – Part 1
- How to Submit An App to Apple: From No Account to App Store – Part 2
- App Distribution Guide (Apple Docs)
- Submitting Your App to the Store (Apple Docs)
Solution 4
Leaving the original answer below, but this has not been the recommended method to create a "release" binary for distribution outside of Xcode in a long time — for that you want to Archive: see answers above.
If you are looking to debug/test a Release build in Xcode, this approach is still relevant.
To create a release build, you have to edit your current scheme (⌘<) and highlight "Run [name of application]. On the right, select "Build Configuration" and choose "Release". Build as usual.
Solution 5
If any one needs to go through how to make Adhoc build, here are quick steps
Product > Archive
then
Export > Save for Ad Hoc Deployment ....
See quick video http://jmp.sh/MQq2yjK
cyclingIsBetter
Updated on February 12, 2022Comments
-
cyclingIsBetter over 2 years
Why is it that when I build an application, Xcode creates a debug build? I want to create a release build. How can I do this?
-
zoul about 13 yearsThis works, care to explain the downvote? When you Archive, you get the binary in built in the release mode the archive. This might not be the most practical way of getting the build, but that depends on blackguardian’s use case.
-
zoul about 13 yearsDo you know if there’s a way to build in the release mode just once, without editing the scheme? (Something like the toggle that used to be in older Xcode versions.) “Build for archiving” does not seem to work for me.
-
Itai Ferber about 13 yearsThat doesn't seem to exist anymore, but it's not an incredible hassle if you use the keyboard shortcut to do it...
-
Helge Becker about 13 years
-
Helge Becker about 13 years
-
jheriko over 11 yearsthis doesn't solve the problem, although it may work. there are ways to run a release build through the debugger.
-
maninvan over 8 yearsThe questions isn't "How to I create a distribution in Xcode?" Creating 'release build' is a normal activity (and to debug them) when the compiler optimizes code incorrectly or verifying debug release only options are disabled. The answer is below, but in short press SHIFT+COMMAND+, and edit the scheme to run release.
-
Alp Altunel about 6 yearson lefthandside you see Product folder. right click it and click "Show in Finder"
-
iji over 4 yearsYou will then be able to push the archive with (Window > Organizer) to App Store Connect and manage your next release from there.