iOS Project Tutorial
This document describes how to automate builds, testing, and deployment of an iOS application project with CircleCI in the following sections:
- Running Tests
- Code Signing and Certificates
- Installing Dependencies
- Running Tests
- Advanced Configuration
- Example Application on GitHub
The following sections walk through how to write Jobs and Steps that use
xcodebuild for this application, how to set up code signing and a provisioning profile in the CircleCI environment, and how to deploy with Fastlane.
- Add your project to CircleCI, see Hello World.
- This tutorial assumes you have an Xcode workspace for your project with at least one shared scheme and that the selected scheme has a test action. If you do not already have a shared scheme, you can add this in Xcode by completing the following steps:
- Open your Xcode workspace or project.
- Use the scheme selector to open the Manage Schemes dialogue box as shown in the following image.
- In the manage schemes dialog, select the scheme you wish to build, and ensure that the Shared checkbox is enabled.
- Commit and push the schemes.
For iOS projects, it is possible to run your tests with Fastlane Scan as follows:
jobs: build-and-test: macos: xcode: 11.3.0 steps: ... - run: name: Run tests command: fastlane scan environment: SCAN_DEVICE: iPhone 6 SCAN_SCHEME: WebTests
Refer to the Xcode version section of the iOS testing document for the complete list of supported versions.
Code Signing and Certificates
Refer to the code signing doc for details.
To further customize your build process to use custom tools or run your own scripts, use the
config.yml file, see the Sample 2.0 config.yml document for customizations.
To install dependencies from homebrew, for example, use a
run step with the appropriate command:
steps: - run: name: Install Homebrew Dependencies command: brew install yarn - run: name: Install Node Dependencies command: yarn install
run step is also used to run your tests as in the following example of the short form
steps: - run: fastlane scan
version: 2.1 jobs: test: macos: xcode: 11.3.0 steps: - checkout - run: fastlane scan deploy: macos: xcode: 11.3.0 steps: - checkout - deploy: name: Deploy command: fastlane release_appstore workflows: test_release: jobs: - test - deploy: requires: test filters: branches: only: release
See the Testing iOS Applications on macOS document for more advanced details on configuring iOS projects.
Example Application on GitHub
circleci-demo-ios GitHub repository
for an example of how to build, test and sign an iOS project using
Fastlane on CircleCI 2.0.