Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 - Dedicated configuration settings : build settings and schemes definition

I'm totally lost with Xcode 4 build settings and schemes.

In Xcode 4, you have those items :

A popup menu in the main project window that allow you to choose the "target" you will run/test/analyse/...

enter image description here

Some build settings :

enter image description here

The Scheme manager :

enter image description here

The scheme editor :

enter image description here

Using those interfaces, How may I define many schemes that have their own build settings for the project.
I mean, today, whatever I do, when I change a build setting when on a scheme, let's say "Debug for me", and select another scheme let's say "Release", the build setting is the one I've changed.

For example, talking about the "RUN" action, how can I have different build settings for "Release on the AppStore", some others for "release on my iPhone", and other ones for "Debug on debug team's iPhone".

Let's say I want to change beetween those profiles the provisionning profile, add / remove some user-defined build settings, change the iOS target, and some other stuff like this ?

All those settings would apply to all targets.
Or specific targets if I want...

How does this can be done ?

like image 891
Oliver Avatar asked Sep 04 '11 12:09

Oliver


People also ask

What is build configuration in Xcode?

A build configuration file is a plain-text file you use to specify the build settings for a specific target or your entire project. Build configuration files make it easier to manage build settings yourself, and to change build settings automatically for different architectures and platforms.

What are schemes in Xcode?

An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. You can have as many schemes as you want, but only one can be active at a time.

Where is Xcode build settings?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.


1 Answers

You don't have to make so many schemes. Even one is enough.

As you can see, there are "Build, Run, Test, Profile, Analyze, Archive" in scheme editor, these settings are for their actions in "Product" menu.

It means, when you clicked "Run" in "Product" menu, Xcode will use your "Run" settings in your scheme.

So, as your settings in your screenshot, when you directly "Run" your App, no matter on iOS Devices or on iOS Simulator, it's always debugging.

Also, when you choose the same scheme and clicked "Archive" in "Product" menu, Xcode will automatically use your "Archive" settings in the scheme, it would be: Release.

Finally, about the "DEBUG TEAM" thing, I am not sure what do your mean, but it looks like some special code sign provisioning file for your test team?

In this situation, you can either change your target's provisioning file setting before building or make a new target using the team provisioning file.

If debug is not required, just "Archive" your App and choose your team provisioning file to sign your App when sharing your App using "Organizer" would be very easy.

Edited: Add some screenshot for help If you want have different settings for same Action "Run" as you said, you need different scheme as well.

Since Xcode allow you to add different Build Configurations, there is no need to create multiple targets. Just "Add" a new Build Configuration as "Pic1" shown, "TeamDebug" for example. Edit your target to set a new provisioning file for the build configuration or what ever you want to set.

Pic1

Then create a new scheme and edit your "Run" settings, choose the Build Configuration you've created before.

Pic2

And you are ready to go.

P.S. In Xcode 4, use "Archive" to build, find the App just builded in "Organizer", choose "Submit" to submit is a better way to release your App to App Store. Or you can also choose "Share" to share your App to the test team.

Hope this Answer can help you out, If it dose, a vote up or choose it as the correct answer would be very appreciated.

like image 97
xuzhe Avatar answered Oct 16 '22 07:10

xuzhe