Home

Awesome

BluepillIcon

Bluepill is a tool to run iOS tests in parallel using multiple simulators.

Motivation

LinkedIn created Bluepill to run its large iOS test suite in a reasonable amount of time. If you want the long story, read the blog post.

Features

Usages

It is quick and easy to start using Bluepill!

$ brew install bluepill
$ bluepill --xctestrun-path ./SampleAppTest_iphonesimulator10.3-x86_64.xctestrun -o ./output/

Alternatively, you can use a configuration file like the one below:

{
   "xctestrun-path": "./SampleAppTest_iphonesimulator10.3-x86_64.xctestrun", # Relative path or abs path
   "output-dir": "./build/" # Relative path or abs path
}

And run

$ bluepill -c config.json

Flags

A full list supported options are listed here.

Config ArgumentsCommand Line ArgumentsExplanationRequiredDefault value
app-aThe path to the host application to execute (your .app)Nn/a
xctestrun-pathThe path to the .xctestrun file that xcode leaves when you build-for-testing.Yn/a
test-plan-pathThe path of a json file which describes the test plan. It is equivalent to the .xctestrun file generated by Xcode, but it can be generated by a different build system, e.g. BazelYn/a
output-dir-oDirectory where to put output log files. (bluepill only)Yn/a
config-cRead options from the specified configuration file instead of the command line.Nn/a
device-dOn which device to run the app.NiPhone 8
exclude-xExclude a testcase in the set of tests to run (takes priority over include).Nempty
headless-HRun in headless mode (no GUI).Noff
clone-simulator-LSpawn simulator by clone from simulator template.Noff
xcode-path-XPath to xcode.Nxcode-select -p
include-iInclude a testcase in the set of tests to run (unless specified in exclude).Nall tests
list-tests-lOnly list tests and exit without executing tests.Nfalse
num-sims-nNumber of simulators to run in parallel. (bluepill only)N4
printf-config-PPrint a configuration file suitable for passing back using the -c option.Nn/a
error-retries-RNumber of times to recover from simulator/app crashing/hanging and continue running.N4
failure-tolerance-fNumber of times to retry on test failuresN0
only-retry-failed-FOnly retry failed tests instead of all. Also retry test that timed-out/crashed.Nfalse
runtime-rWhat runtime to use.NiOS 13.3
stuck-timeout-STimeout in seconds for a test that seems stuck (no output).N300s
test-timeout-TTimeout in seconds for a test that is producing output.N300s
test-bundle-path-tThe path to the test bundle to execute (single .xctest).Nn/a
additional-unit-xctestsn/aAdditional XCTest bundles that is not Plugin folderNn/a
additional-ui-xctestsn/aAdditional XCTUITest bundles that is not Plugin folderNn/a
repeat-count-CNumber of times we'll run the entire test suite (used for load testing).N1
no-split-NTest bundles you don't want to be packed into different groups to run in parallel.Nn/a
quiet-qTurn off all output except fatal errors.NYES
diagnosticsn/aEnable collection of diagnostics in output directory in case of test failures.NNO
help-hHelp.Nn/a
runner-app-path-uThe test runner for UI tests.Nn/a
screenshots-directoryn/aDirectory where simulator screenshots for failed ui tests will be stored.Nn/a
videos-directoryn/aDirectory where videos of test runs will be saved. If not provided, videos are not recorded.Nn/a
keep-passing-videosn/aWhether to keep the recorded video for passing tests. Deleted by default.Nfalse
video-paths-VA list of videos that will be saved in the simulators.Nn/a
image-paths-IA list of images that will be saved in the simulators.Nn/a
unsafe-skip-xcode-version-checkSkip Xcode version checkNNO
retry-app-crash-testsRetry tests that crashed app and consider it non-fatal if it passes on retry.Nfalse

Exit Status

The exit code of Bluepill uses bit indicators which could represent multiple exit status. Please refer to the header for meaning of each bit.

Demo

BluepillDemo

Requirements

Bluepill officially supports Xcode 14.0. If you're looking for old Xcode support, please checkout the following branches:

If you're looking for newer Xcode version support, try using Bluepill with unsafe-skip-xcode-version-check flag but make sure your app is tested with it and the underlying risks are understood.

Acknowledgement

Bluepill was inspired by parallel iOS test and Facebook’s xctool and FBSimulatorControl. The Bluepill icon was created by Maria Iu.

Fastlane Support

If you're using Fastlane to run your tests, you're in luck! You can integrate Bluepill into your project with very little change to your existing setup. Just integrate one of the following Fastlane plugins, and you'll be on your way:

Bitrise.io Support

If you're using Bitrise.io as your CI/CD, you can start using Bluepill immediately. Just add the Bluepill Build/Test for iOS step to your existing workflow. This open source step is maintained by HealthEngineAU and supports Xcode 8.3 and later.

Q & A