54
votes

There are no other way, I search a lot. In XCode 3 this is easy, but now..

In the screen above, I have the Build Configuration, so I can chose if I want:

  • Debug
  • Release

the screen

This 2 kind of config, have their own config in "Build Settings" tabs (in targets config). To create I third one, the Distribution, reading here, it show this image in XCode 3 boring xcode 3

Where I can do the same in XCode 4????

edit-> Only create a new Schema didn't work, like this is a config in "Build Settings" tag of Targets. I can chose a config for "Debug" and "Release", but, and for I third one?

enter image description here

3

3 Answers

114
votes

Have a look at the project settings. There is a + button that you can use to add to configurations here.

enter image description here

8
votes

You don't need it.

Make sure you check the following list before you Archive:

  • In Edit Scheme: Select Release as Build Configuration for Archive,

  • In Project Build Setting: Set Entitlements.plist and your Distribution code signing for Release scheme,

  • In Entitlements.plist: Set No to ‘can be debugged’.

Then archive and share with your ad-hoc provisioning or submit with distribution provisioning.

Hope this is a comprehensive checklist.

EDIT:

to duplicate an existing configuration: enter image description here

6
votes

I had a similar issue where I wanted some special behaviour for beta builds

These are the steps I took (mostly an expansion of the answer given by @ZhangChn)

  1. Duplicate the Release Configuration and rename it beta.
  2. Added a BETA pre-processor macro to the Beta Configuration under build settings.
    • Make other changes to your build configuration here.
  3. Go into manage schemes and duplicate the main scheme for my project and rename it to Beta.
  4. Edit the new scheme and change the target build configuration to beta (or whatever you named your new build configuration.
  5. ...
  6. Profit!!!!

Or not, at any rate you should now be able to switch your desired setting simply by changing the scheme you're using instead of mucking about with settings every time.