icon

Xcode Build for testing for iOS

Performs xcodebuild's build-for-testing action

The Step runs Xcode's xcodebuild command with the build-for-testing option. This builds your app and associated tests so that you can, for example, upload it to a third-party testing service to run your tests on a real device. The Step also creates an .xctestrun file. To be able to run your tests on a real device it needs code signing. The Automatic code signing method Step input allows you to log you into your Apple Developer account based on the Apple service connection you provide on Bitrise and download any provisioning profiles needed for your project based on the Distribution method. Please note that the Automatic code signing method input is by default set to off, so if you need code signing, select either the api-key or the apple-idoption of the input.

Configuring the Step

Before you start:

  • Make sure you have connected your Apple Service account to Bitrise. Alternatively, you can upload certificates and profiles to Bitrise manually, then use the Certificate and Profile Installer Step before this Step.
  • Make sure certificates are uploaded to Bitrise's Code Signing tab. The right provisioning profiles are automatically downloaded from Apple as part of the automatic code signing process.

To configure the Step:

  1. Project (or Workspace) path: This is the path where the .xcodeproj or .xcworkspace files are localed.
  2. Scheme: Add the scheme name you wish to build for testing.
  3. Build Configuration: If not specified, the default Build Configuration will be used. The input value sets xcodebuild's -configuration option.
  4. Device destination specifier: Destination specifier describes the device to use as a destination. The input value sets xcodebuild's -destination option.

Under xcodebuild configuration 5. Build settings (xcconfig): Build settings to override the project's build settings. Can be the contents, file path or empty. 6. Additional options for the xcodebuild command: Additional options to be added to the executed xcodebuild command.

Under Xcode build log formatting:

  1. Log formatter: Defines how xcodebuild command's log is formatted. Available options: xcpretty: The xcodebuild command's output will be prettified by xcpretty. xcodebuild: Only the last 20 lines of raw xcodebuild output will be visible in the build log. The raw xcodebuild log is exported in both cases.

Under Automatic code signing:

  1. Automatic code signing method: Select the Apple service connection you want to use for code signing. Available options: off if you don't do automatic code signing, api-key if you use API key authorization, and apple-id if you use Apple ID authorization.
  2. Register test devices on the Apple Developer Portal: If this input is set, the Step will register the known test devices on Bitrise from team members with the Apple Developer Portal. Note that setting this to yes may cause devices to be registered against your limited quantity of test devices in the Apple Developer Portal, which can only be removed once annually during your renewal window.
  3. The minimum days the Provisioning Profile should be valid: If this input is set to >0, the managed Provisioning Profile will be renewed if it expires within the configured number of days. Otherwise the Step renews the managed Provisioning Profile if it is expired.
  4. The Code signing certificate URL, the Code signing certificate passphrase, the Keychain path, and the Keychain password inputs are automatically populated if certificates are uploaded to Bitrise's Code Signing tab. If you store your files in a private repo, you can manually edit these fields.

If you want to set the Apple service connection credentials on the step-level (instead of using the one configured in the App Settings), use the Step inputs in the App Store Connect connection override category. Note that this only works if Automatic code signing method is set to api-key.

Under Step Output configuration:

  1. Output directory path: This directory contains the generated artifacts.

Under Caching:

  1. Enable collecting cache content: Defines what cache content should be automatically collected. Available options are:
  • none: Disable collecting cache content
  • swift_packages: Collect Swift PM packages added to the Xcode project

Under Debugging:

  1. Verbose logging*: You can set this input to yes to produce more informative logs.

Similar steps

Build your XCTest or XCUITest runner to upload to remote testing service

Builds your Android project with Gradle with the belonging AndroidTest variant.

Automatically manages your code signing assets, archives and exports an .ipa in one Step.

Runs xcodebuild commands for simulators