Xcode Build task

TFS 2017 | TFS 2015

Use this task to build an Xcode workspace on macOS.

Demands

xcode

Arguments

Argument Description
Actions Space-delimited list of actions. Valid options are build, clean, test, analyze, and archive. For example: clean build would run a clean build. See Apple: Building from the command line with Xcode FAQ.
Configuration The default value is $(Configuration). Make sure to specify a value (for example, Release) on the variables tab.
SDK The default value is $(SDK). Make sure to specify a value (for example, iphonesimulator) on the variables tab.
Workspace Path (Optional) Relative path from repo root to where the xcworkspace folder exists. If you specify a value, you must also specify the Scheme. Do not specify a value if you are specifying the -target flag in Advanced, Arguments (described below).
Scheme (Optional, unless you specify the Workspace Path, described above.) Scheme name in Xcode. Must be a shared scheme (with shared check box under managed schemes in Xcode selected).
Create App Package Select if you want to create an .IPA app package file.

(Optional) Signing and provisioning options

Argument Description
Xcode 8 Automatic Signing Select this if you have an Xcode 8 project setup for Automatic Signing.
Team ID (Optional) Specify the 10 digit developer Team ID. This is required if you are a member of multiple development teams.
Override Using (Optional)

If the build should use a signing or provisioning method that is different than the default, choose that method here.

Choose File Contents to use a P12 certificate and provisioning profile. Choose Identifiers to retrieve signing settings from the default Keychain and pre-installed profiles.

Leave the corresponding fields blank if you do not wish to override default build settings.

P12 Certificate File Relative path to a PKCS12-formatted .p12 certificate file that contains a signing certificate to be used for this build.
P12 Password Password to the .p12 file.
Important: Use a secret variable to avoid exposing this value.
Provisioning Profile File Relative path to .mobileprovision file that contains the provisioning profile override to be used for this build.
Remove Profile After Build Select if you want the contents of the provisioning profile file to be removed from the build agent after the build is complete.
Important: Select only if you are running one agent per user.

Package options

Argument Description
Archive Path Optionally specify a directory where created archives should be placed.
Export Path Optionally specify the destination for the product exported from the archive.
Export Options Pick a way to pass in Export Options when exporting the archive. The task automatically detects the export method from the archive when the default Auto is selected. You can specify the export method and Team ID in the task by selecting Specify or provide the export options via a plist file by choosing Plist.
Export Method Method for how Xcode should export the archive. E.g. app-store, package, ad-hoc, enterprise, development.
Team ID The 10 digit Team ID from the Apple Developer Portal to use for this export.
Export Options Plist Path to a plist file that configures archive exporting.

Advanced options

Argument Description
Arguments (Optional) Specify additional command-line arguments for this build. See Apple: Building from the command line with Xcode FAQ.
Working Directory Working directory for the build. If you leave it blank, it is the root of the repo.
Output Directory Relative path where build output (binaries) will be placed. The default value includes build variables. Make sure to specify values on the variables tab.
Xcode Developer Path (Optional) Path to Xcode Developer folder if you are not using the system default. Specify this argument when you've got multiple versions of Xcode installed your build agent. For example: /Applications/Xcode 7.app/Contents/Developer
Use xcpretty Use xcpretty to format xcodebuild output and generate JUnit test results report. You must have xcpretty installed on the agent.
If you select this option, make sure that Use xctool is cleared.
Publish to Azure Pipelines/TFS If you have selected Use xcpretty (described above), select this option if you want to publish JUnit Test results to Azure Pipelines/TFS.

xctool (deprecated) options

Argument Description
Use xctool Select if you want to run xctool instead of xcodebuild. You must have xctool installed on the agent.
If you select this option, make sure that Use xcpretty is cleared.
xctool Test Reporter Format You can specify this argument if you have selected Use xctool and included test in Actions (arguments described above). Specify junit:output-file-path-here.xml to generate a file that you can publish using the Publish Test Results task. When specified, plain is automatically added as well.

Task control options

Example

Build and test Xcode projects

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

FAQ

Do I need an agent?

You need at least one agent to run your build or release.

I'm having problems. How can I troubleshoot them?

See Troubleshoot Build and Release.

I can't select a default agent pool and I can't queue my build or release. How do I fix this?

See Agent pools.

My NuGet push task is failing with the following error: "Error: unable to get local issuer certificate". How can I fix this?

This can be fixed by adding a trusted root certificate. You can either add the NODE_EXTRA_CA_CERTS=file environment variable to your build agent, or you can add the NODE.EXTRA.CA.CERTS=file task variable in your pipeline. See Node.js documentation for more details about this variable. See Set variables in a pipeline for instructions on setting a variable in your pipeline.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on Azure Pipelines and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.