How do I create a release build in Xcode?
Asked Answered
M

7

109

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?

Misuse answered 18/4, 2011 at 17:26 Comment(0)
K
34

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"

Kimmy answered 18/4, 2011 at 17:28 Comment(6)
This 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.Rosy
#5287713Kimmy
developer.apple.com/library/mac/#documentation/IDEs/Conceptual/…Kimmy
this doesn't solve the problem, although it may work. there are ways to run a release build through the debugger.Sestos
The 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.Borlase
You will then be able to push the archive with (Window > Organizer) to App Store Connect and manage your next release from there.Drabbet
C
167

Product / Scheme / Edit Scheme..

enter image description here

And from the menu that comes up, select Release under "Build Configuration".

enter image description here

Clyster answered 3/8, 2013 at 23:39 Comment(0)
E
65

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.

enter image description here

Then go to Product > Archive.

enter image description here

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.

Ebenezer answered 5/1, 2017 at 23:49 Comment(0)
K
34

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"

Kimmy answered 18/4, 2011 at 17:28 Comment(6)
This 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.Rosy
#5287713Kimmy
developer.apple.com/library/mac/#documentation/IDEs/Conceptual/…Kimmy
this doesn't solve the problem, although it may work. there are ways to run a release build through the debugger.Sestos
The 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.Borlase
You will then be able to push the archive with (Window > Organizer) to App Store Connect and manage your next release from there.Drabbet
B
30

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.

Bellbottoms answered 18/4, 2011 at 17:49 Comment(3)
Do 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.Rosy
That doesn't seem to exist anymore, but it's not an incredible hassle if you use the keyboard shortcut to do it...Bellbottoms
on lefthandside you see Product folder. right click it and click "Show in Finder"Arbe
E
14

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 https://jumpshare.com/v/rHLJII2npwyHCgGCabQA

Enrika answered 12/3, 2018 at 15:24 Comment(1)
Hint: This answer is a good one for Ad Hoc development. thanks.Predestination
T
1

Follow these steps:-

  1. Go to product option
  2. select Scheme option
  3. Edit Scheme option
  4. change Debug to Release

Make sure Through this you can run build in your physical device if you are disconnected to System.. but if you will run the same code o n simulator then you will face some error then that time you need to change the scheme option Release to Debug

Tollgate answered 21/7, 2022 at 12:35 Comment(0)
S
0

Here is my 'more detailed' list of steps for creating a release build > (Working on a team and a project that has many schemes and environments)

  1. checkout a new branch like releases/x.x.x that contains all changes. (x.x.x is the version) (Its more about your team conventions)
  2. Check to make sure your app bundleIdentifier is correct (might differ for each environment)
  3. Team/account/licence: log into correct account that has provisioning profiles. then under signing and capabilities make sure your Team is correctly selected and has all certificates needed
  4. Upgrade the version in project settings to x.x.x
  5. Make sure the scheme you selected is correct
  6. Make sure the URLs of API calls are pointing to your release environment
  7. Its better to select 'Any iOS device' instead of a simulator or actual device
  8. Commit any changes locally if you have any (this step is very important)
  9. Validate to make sure all is good
  10. Create an archive
  11. Distribute your app for AppStore Connect

I use an apple proxy named 'transporter' that is pretty easy for uploading iPA to Appstore

Happy releasing!

Sweatshop answered 11/2, 2022 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.