About the Scheme Editor
Use the scheme editor to manage and edit Xcode schemes. Choose Manage Schemes from the scheme menu in the toolbar to manipulate schemes as a group. Choose New Scheme to create a new scheme, or Edit Scheme to edit the current existing scheme.
A scheme is a collection of settings that specify which targets to build, what build configuration to use, and the executable environment to use when the product specified by the target is launched. When you open an existing project (or create a new one), Xcode automatically creates a scheme for each target.
To choose the active scheme and the run destination, use the scheme toolbar menu in the Xcode workspace window. The Scheme toolbar menu lets you select a combination of scheme and destination, but the two are distinct. A scheme does not include the destination.
You access the scheme editor by choosing Edit Scheme from the scheme menu.
You can use the pop-up menus at the top of the scheme editing dialog to choose a different active scheme or destination. When you change to a different scheme, all the settings change to whatever is set for that scheme. When you change the destination, nothing else changes.
The scheme editor allows you to specify many settings that affect your workflow. The left column lists actions that correspond to commands in the Product menu: Run, Test, Profile, Analyze, and Archive. Build is a special item that allows you to select the targets to build for each of these actions.
When you select an action in the list, Xcode displays a pane with settings that affect what happens when you choose the corresponding command. For example, the settings in the Run pane configure the Run command.
You can customize each action in a scheme. There are phases before and after each action to run shell scripts and send email. To edit the pre-action and post-action phases for a particular action, click the action’s disclosure triangle. For example:
In the example, the Build phase disclosure is open and post-actions is selected. An email notification action to be sent when the build succeeds is shown.
When you first use the scheme editor to add a pre-action or post-action, a “No Actions” image is presented.
Click Add (+) at the bottom left corner of the sheet and choose whether to add a script or an email notification action.
When you change a setting in a scheme, the change takes effect immediately.
One way to create a new scheme is to click Duplicate Scheme, which uses the active scheme as a template. To display and manage a list of existing schemes, click Manage Schemes.
If your workspace contains projects and targets that build more than one product, you can create separate schemes for the different products. For projects with large codebases and multiple developers, you can create multiple schemes to represent distinct subsystems.