Skip to end of metadata
Go to start of metadata

The Xcode Project Build Runner supports Xcode 3 (target-based build), Xcode 4 (scheme-based build), Xcode 5, 6 and since TeamCity 9.1, Xcode 7.x and Xcode 8.

The runner provides structured build log based on Xcode build stages, detects compilation errors, reports tests from the xcodebuild utility, adds automatic agent requirements for the appropriate version of tools installed (Xcode, SDKs, etc.) and reporting tools via agent properties.

Icon

To run an Xcode build, you need to have one or more build agents running Mac OS X with installed Xcode.

 

Working with different Xcode setups:

  •  If only one Xcode version is installed on the agent machine, it will be used by default. The agent restart is required if Xcode was installed/updated.
  •  If several Xcode versions are installed, perform one of the following:
    - specify the path to the required version in the Path to Xcode of the Xcode Project build step settings 
    - select the default XCode distribution using the xcode-select tool (details on Apple.com).
    The path to Xcode: /Applications/Xcode.app/Contents/Developer
    Command to switch: sudo xcode-select -s path_to_xcode_distribution
Icon

Note that if you use xcode-select, the agent must be restarted, as it only detects Xcode distributions and reports them to the server during startup.

 

Xcode Project Runner Settings

Setting

Build

Description

Path to the project or workspace

 

The path to a (.xcodeproj) project file or a (.xcworkspace) workspace file, should be relative to the checkout directory. For Xcode 3 build, only the path to the project file is supported.

Working directory

 

Specify the build working directory.

Path to Xcode

 

Specify the path to Xcode on the agent. The build will be run using this Xcode.

Build

 

Select either a target-based (for project) or scheme-based (for project and workspace) build. Depending on the selection, the settings displayed will vary.

Scheme

Scheme-based    

Xcode scheme to build. The list of available schemes is formed by parsing your project/workspace files in the VCS. Make sure your Path to the project or workspace is set correctly and click the Check/Reparse Project button to show/refresh the schemes list. Note that a scheme must be shared to be shown in the list (to check if your scheme is shared, verify that it is located under the xcshareddata folder and not under the xcuserdata one, and that the xcshareddata folder is committed to your VCS. To check the latter, use the VCS tree popup next to the Path to the project or workspace field). More information on managing Xcode schemes is available in the Apple documentation.

Build output directory

Scheme-based

Check the Use custom box to override the default path for the files produced by your build. Specify the custom path relative to the checkout directory.

Target

Target-based

Xcode target to execute. The list of available targets is formed by parsing your project files in the VCS. Make sure your Path to the project is set correctly and click the Check/Reparse Project button to show/refresh the targets list.

Configuration

Target-based

Xcode configuration. The list of available configurations is formed by parsing your project files in the VCS. Since the configuration depends on the target, you must choose the target first. Make sure your Path to the project is set correctly and click the Check/Reparse Project button to show/refresh the configurations list.

Platform

Target-based

Select from the default, iOS, Mac OS X or Simulator - iOS or any other platform (if it is provided by the agent) to build your project on.

SDK

Target-based

You can choose a SDK to build your project with (the list of available SDKs is formed according to the SDKs available on your agents for the platform selected.

Architecture

Target-based

You can choose an architecture to build your project with (the list of available architectures is formed according to the architectures available on your agents for the platform selected).

Build action(s)

 

Xcode build action(s). The default actions are clean and build. A space-separated list of the following actions is supported: clean, build, test, archive, installsrc, install; the order of actions will be preserved during execution.

(warning)It is not recommended to change this field unless you are sure you want to change the number or order of actions.

Icon

If your project is built under Xcode 5+, checking the Run test option below automatically adds the test build action to the list (unless the option is already explicitly specified in the current field).

Run tests

 

Сheck this option if want to run tests after you project is built.

Additional command line parameters

 

Other command line parameters to be passed to the xcodebuild utility.



See also:

Concepts: Build Runner

  • No labels

11 Comments

  1. When will the Xcode plugin be production grade for Xcode 7? Xcode is no longer beta. We have some build issues to resolve, and developers love to point their fingers at TeamCity. 

    1. Richard, thanks for your comment. TeamCity supports Xcode 7 production release,  and the documentation has been fixed accordingly. If you experience any issues, don't hesitate to use our forum to ask for assistance.

  2. Is there a plan to make this work with a template?  Scheme parsing from the workspace/project file will never work in a template.

    1. David Ridner there is an issue for this in our tracker: TW-24914. Please watch vote. As a workaround you can use command line runner to run xcodebuild with -scheme parameter

  3. Additional command line parameters is not available in TeamCity Professional 9.1.5 (build 37377). Anything I can do set additional params in a different way?


    1. Have you expanded advanced options by clicking on 'Show advanced options' label at the bottom ob build step configuration page?

      1. Silly me! Thank you, that solved the issue.

  4. How do you distinguish running on a "Development" provisioning profile or a "Distribution" provisioning profile. Is there a flag you can set?

    1. It is not possible to switch provisioning profile by setting a flag or adding a command line option. The recommended way is to define separate targets for each profile you are using and running xcodebuild with desired target

  5. Does TeamCity 10.x detect Xcode 8.x and run builds properly? I saw a comment regarding to the previous version, that TeamCity 9.x didn't support Xcode 8 officially, but It was able to detect Xcode 8 (beta) already and run the builds correctly.

    Could you please check for me that TeamCity 10.x / 9.x are able to detect and run builds using Xcode 8.x for Objective-C-only and Swift-only projects?

    1. TeamCity works with XCode 8.x correctly