New to fastlane? Click here to open the installation & setup instructions first
1) Install the latest Xcode command line tools
2) Install fastlane
# Using RubyGems sudo gem install fastlane -NV # Alternatively using Homebrew brew cask install fastlane
3) Navigate to your project and run
Running iOS tests using fastlane
To run your unit tests or UI tests using fastlane, add the following to your
lane :tests do run_tests(scheme: "MyAppTests") end
Additionally you can specify more options for building and testing your app, for example
lane :tests do run_tests(workspace: "Example.xcworkspace", devices: ["iPhone 6s", "iPad Air"], scheme: "MyAppTests") end
Check out the list of all available parameters
To use the newly created lane, just run
Setting up fastlane to run on CI
To run iOS tests using fastlane on a Continuous Integration service, check out the Continuous Integration docs.
Since fastlane stores all configuration in simple configuration files, and runs via the command line, it supports every kind of CI system.
We also prepared some docs to help you get started with some of the popular CI systems.
If your CI system isn't listed here, no problem, fastlane runs on any CI. To trigger fastlane, just add the command you would usually run from your terminal:
Setting up the environment
Posting build results
If you want to post test results on Slack, Hipchat or other team chat client, check out the available fastlane actions.
If you're using Slack, this is already built-into the default
run_tests action, just provide your Slack URL:
lane :tests do run_tests(scheme: "MyAppTests", slack_url: "https://hooks.slack.com/services/T03N...", slack_channel: "#channel") end
To get the
slack_url, create an
Incoming WebHook for your Slack group.
To post a message when fastlane encounters a test or build failure, add the following to your
error do |ex| hipchat(message: "Tests have failed!", channel: "Room or @username", success: false) end
The above example uses Hipchat, but fastlane supports many other services out there.