Build for debug is just press on the PLAY symbol, but I don't know how to Build for distribution/release?
-
[iPhone - how to change the build configuration to distribution](http://stackoverflow.com/q/8804248/194544) – beryllium Mar 26 '12 at 19:59
9 Answers
The short answer is:
- choose the iOS scheme from the drop-down near the run button from the menu bar
- choose product > archive in the window that pops-up
- click 'validate'
- upon successful validation, click 'submit'
-
3Also, the same workflow applies for building Mac apps. Once you have them archived, you can get the binary from the archive bundle in the Finder (right-click on the Archive in the Organizer and select "Show in Finder") – DaGaMs Sep 15 '11 at 23:01
-
+1 for providing another solution. I added another answer with more detail about this method of distributing your app using the Application Loader instead of the archiving and distributing. – whyoz May 16 '12 at 17:55
-
You can use command line tool to build the release version. Next to your project folder, i.e.
$ ls
...
Foo.xcodeproj
...
Type the following build command:
$ xcodebuild -configuration Release

- 980
- 8
- 16
-
Thats on command tool cd into the folder containing the .xcodeproj file and run the command – Jon Nov 01 '15 at 13:18
-
Nice answer shao-chuan wang. It works like charm. I want to add little in this. If you want to make the release build for ios projects follow below steps. It works – Amit Thakur Oct 06 '17 at 12:10
The "play" button is specifically for build and run (or test or profile, etc). The Archive action is intended to build for release and to generate an archive that is suitable for submission to the app store. If you want to skip that, you can choose Product > Build For > Archive to force the release build without actually archiving. To find the built product, expand the Products group in the Project navigator, right-click the product and choose to show in Finder.
That said, you can click and hold the play button for a menu of other build actions (including Build and Archive).

- 60,946
- 14
- 140
- 135
They've bundled all the target/build configuration/debugging options stuff into "schemes". The transition guide has a good explanation.

- 12,337
- 5
- 48
- 63
I have a large app that was having problems uploading to the AppStore using the archive method you will find in XCode 4. The activity indicator kept spinning for hours whether I was trying to validate or distribute, so I created a support ticket to Apple. During that process, I found out you could right click on the .app in your Products folder inside the Project Navigator of XCode, and compress the app to submit using the Application Loader 2.5.1. (aka the old method). Only the Debug - iphoneos folder is accessible this way (for now) and once Apple responded, this is what they had to say:
I'm glad to hear that Application Loader has provided you a viable workaround. Discussing this situation internally, we're not sure that submitting the Debug build will pose too much of a problem (so long as it was signed with the App Store distribution profile, as you mentioned it was). The app will likely be slower as the debug switches are turned on and optimizations are turned off for the Debug configuration, though it will still run. App Review will ultimately determine whether or not that's ok, as I'm not sure that's something they check for. You could try reaching out directly to App Review to confirm this, if you wish. However, since App Loader is working for you, I do recommend rebuilding the app with your Release configuration and resubmitting to play it safe. To find your Release build in Xcode 4.x, control-click on the Application Archive on the Archives tab in the organizer, and choose "Show in Finder." Then, control-click on the .xcarchive file in Finder and choose "Show Package Contents." The release built .app file should be located within the /Products/Applications folder.
This was very helpful information for developers who are having problems with the archive method, and my app is now uploading successfully without any concern that it won't run to the best of it's ability.

- 5,168
- 47
- 53
To set the build configuration to Debug or Release, choose 'Edit Scheme' from the 'Product' menu.
Then you see a clear choice.
The Apple Transition Guide mentions a button at the top left of the Xcode screen, but I cannot see it in Xcode 4.3.

- 131
- 1
- 3
- 19
That part is now located under Schemes. If you edit your schemes you will see that you can set the debug/release/adhoc/distribution build config for each scheme.

- 1,985
- 20
- 33
-
1i am running on xcode 4.3 the latest one with iOS5.. can you guide me to build for distribution.. my client wants to check app(OTA) before submitting to apple – Harin Oct 20 '11 at 16:26
Product -> Archive, later, press the distribute button and check the option Export as Application or what you want

- 363
- 2
- 14