How to Create and Configure a Build Scheme in Xcode

When developing a system, you may want to use different settings depending on the environment when deploying your program to QA or production.

Here, we'll explain how to create and configure Build Schemes in Xcode to manage environment-specific settings.

This assumes that Build Configurations have already been added. If not, please go back to the How to Manage Environment Settings in Xcode index and add them first.


Create and Configure a Build Scheme in Xcode

A build scheme defines which target to build, the build configuration to use, and other options.

It's best to create separate schemes for each environment so that you can select the scheme when running or archiving.


Let's set up build schemes for each environment in Xcode.

Next to the Run/Stop button, there's a scheme selector. Click it and choose [Manage Schemes...].

How to Create and Configure a Build Scheme in Xcode 8

How to Create and Configure a Build Scheme in Xcode 9


When you create a new project in Xcode, a default scheme with the project name is automatically generated.

How to Create and Configure a Build Scheme in Xcode 10


Rename this scheme to Development, select it, and then click the [Edit] button.

How to Create and Configure a Build Scheme in Xcode 11


On the left side, select Run, Test, Profile, Analyze, and Archive in order. Each should already be configured to use Development Debug, Debug, Release, Debug, and Release configurations, respectively.

How to Create and Configure a Build Scheme in Xcode 12


Now create similar schemes for QA and Production.

Click the [Duplicate Scheme] button and rename it to QA.

How to Create and Configure a Build Scheme in Xcode 13


For Run, Test, Profile, Analyze, and Archive, change the Build Configurations to QA's Debug, Debug, Release, Debug, and Release.

How to Create and Configure a Build Scheme in Xcode 14


Do the same to create a Production scheme. Also, enable Share so the schemes can be used across different Xcode environments.

Now you have schemes for Development, QA, and Production environments.

How to Create and Configure a Build Scheme in Xcode 15


By selecting a scheme here, the Build Configuration specified in that scheme will be applied when running or archiving.

How to Create and Configure a Build Scheme in Xcode 16


That's how to create and configure Build Schemes in Xcode to manage environment-specific settings.