Skip to main content
Integrating MobileBoost into your CI pipeline enables automated test execution against your latest app builds.

GitHub Actions

Run your tests from GitHub Actions with the actions in MobileBoostHQ/actions. You reference them directly in your workflow, so there is nothing to install.
  • upload-build uploads your build and returns its build-id.
  • run-tests runs your tests by tag or ID, waits for them to finish, and fails the job if a test fails.

Add your credentials

In your repository, go to Settings > Secrets and variables > Actions.
  • In the Secrets tab, add MOBILEBOOST_API_KEY. Create the key in MobileBoost under Settings > API keys.
  • In the Variables tab, add MOBILEBOOST_ORG_ID, your organisation ID. Ask your MobileBoost contact if you do not have it.

Run your tests against a build

Upload the build your pipeline produced, then run every test with one of the tags you list:
  • mode: ai-sdet runs the test code MobileBoost wrote and verified for each of your tests, on MobileBoost devices.
  • tags runs every test that has at least one of the tags. Use test-ids to run specific tests, or both to run both sets.
  • async: false makes the step wait for the run. It then writes a result table with links to each recording into the job summary, and fails the job if a test failed or was blocked.
build-path takes an .apk, an .ipa for physical iOS devices, or a .zip or .tar.gz of the .app for iOS simulators. A directory is zipped for you, and a glob uses its first match. See Build requirements.

Run against the app installed on your device

If your organisation tests the app already installed on its reserved device, such as the App Store or Play Store version, you do not need to upload a build. Name the app by its bundle ID (iOS) or package name (Android) and its platform instead:
  • The tests run on your physical device, the only kind with your app installed.
  • They test the version installed on the device, not the code of the commit that started the workflow. That makes this a good fit for scheduled and manual runs. To test a pull request’s changes, upload the build it produced instead.
  • Running without a build has to be enabled for your organisation. Ask your MobileBoost contact.
Requires version 1.9.0 of the actions. @v1 picks it up automatically.

run-tests inputs

The step outputs run-id, and with async: false also passed, failed and blocked. Every selected test must have its automation written and verified for the platform; see Step 2: Start a run.

Results on the pull request

When a run comes from a pull request, MobileBoost can post its results as a comment on that pull request: what passed, what failed and why, with links to the reports. Install the MobileBoost GitHub App on the repository and ask your MobileBoost contact to turn the comments on. No permissions: block or GITHUB_TOKEN is needed.

Pin the version

  • @v1 is recommended. It gets every v1.x.x release, with fixes and no breaking changes.
  • @v1.9.0 pins an exact version.

Run the tests a pull request describes

The MobileBoost Test Action works differently: it uploads your build and sends the pull request description, which holds the test instructions, to MobileBoost in a single step.
For how to write the instructions, see the format requirements. The action takes organisation-id (store it as the secret MOBILEBOOST_ORG_ID), app-path (the .apk or .ipa) and platform (Android or iOS).
If your app talks to a staging environment that is not reachable from the public internet, open a tunnel in the same job so the devices can reach it. See Local testing in CI.

CI provider snippets

For other CI systems, use the upload API to send your build artifact and capture the returned buildId.
In all examples below, replace <ORG_KEY> with your MobileBoost organisation key, <platform> with ios or android, and the build file path with the actual path to your artifact.
Add a Script step to your workflow after the build step. This uploads the build and makes the buildId available as an environment variable for subsequent steps.
Link each build to its pull request (recommended). Pass a ci field so MobileBoost knows which pull request produced each build. Results then map back to the right PR, and MobileBoost can select the tests relevant to that PR’s changes. Every value comes from a built-in Bitrise variable, so there is nothing extra to create.
Each ci field maps to a variable Bitrise sets automatically:
$BITRISE_PULL_REQUEST and $BITRISEIO_GIT_BRANCH_DEST are only set on pull-request-triggered builds, so make sure your workflow runs on pull requests (App settings > Triggers). On non-PR builds the snippet omits prNumber and links the build by commit instead - no changes needed.
The only value you provide yourself is your organisation key - store it as a Secret (App settings > Secrets) and reference it (for example $MOBILEBOOST_ORG_KEY) instead of hardcoding <ORG_KEY>. The build path is whatever your build step produces ($BITRISE_APK_PATH for Android, $BITRISE_IPA_PATH for iOS).

API

For full control, use the API directly. The process has three steps: upload the build, start a run, then read its results. Send your API key as Authorization: Bearer mb_live_... on each call.

Step 1: Upload the build

Upload your build artifact using the upload endpoint. The response returns a buildId.

Step 2: Start a run

Send the buildId from step 1 to POST /tests/execute. Run specific tests by ID:
Run tests by tags: tags runs every test that has at least one of the tags. Send testIds as well to add specific tests to the run.
Run the newest build with a name: If your pipeline doesn’t keep the buildId, name the build instead. The run uses the newest build uploaded under that name for platform:
A test is runnable on the platform once its automation has been written and verified. GET /tests shows this as platforms.<platform>.runnable.
  • A test you name in testIds must be runnable, or the request is refused with 400.
  • A test that only matches tags and is not runnable yet is skipped, and the rest of the run starts. If none of the tests matching tags is runnable, the request is refused with 400 and the message lists them.
The response carries the ID of the run in runId, and lists any skipped test in skippedTests:
reason is one of not_automated, generation_in_progress, generation_failed, generation_blocked or not_ready. Print warnings in your pipeline log so a skipped test does not go unnoticed. A skipped test never fails the run.
deviceConfigs, deviceProviderSettings, launchParams, testInputs, tagsQuery, iterations and metaData are not supported. A request that sends any of them is refused with 400, so a run never goes ahead on settings it ignored. Send the values testInputs carried as variables instead.

Pass values to the tests

Some values belong to one run rather than to your tests: the backend a canary run signs in against, or a feature flag a nightly run switches on. Send them as variables:
Each test in the run reads them as environment variables. A value here wins over your organisation’s environment variable of the same name, for this run only, so a test can fall back to your organisation’s value when a run sends none. The response lists the names it received in variables.
  • Names use upper case letters, digits and underscores, and start with a letter. Names the test runner relies on, such as PATH or anything starting with PYTHON, are refused with 400. Values must be strings, and a run takes up to 20.
  • Send your API key. A request with variables needs it even if your organisation does not otherwise require one, because a variable can change which host a test signs in to.
  • Not for passwords or keys. The values are kept with the run for 14 days so a retry finds them. Keep credentials in your organisation’s environment variables (ENV Variables in the web app), where every read is audited.
A test only uses a variable it reads. If a test has a backend address written into it, change the test to read the variable first.

Step 3: Get the results

Pass runId to GET /runs/{runId}, and repeat the call until status is completed or cancelled:
  • completed means every test has finished, not that every test passed. Fail your pipeline when failedTests is not empty.
  • skippedTests repeats the tests that were left out when the run started, in the same shape as in step 2. They are not counted in totalTests and never change status.
  • While the run is in progress, runningTests and queuedTests show which tests are on a device and which are waiting for one.
  • Step 2 returns just before the run is saved, which usually takes under half a second. Wait 2 seconds before your first call. If it answers 404, retry every 2 seconds. A 404 that lasts longer than 30 seconds means the run was not created: check the runId, then start the run again.
  • While status is initial, tests are still being added to the run, so totalTests can still grow. This takes up to about 10 seconds for a run of 100 tests.
A minimal polling loop:

Build requirements

Before tests can run, your application build must be uploaded to MobileBoost.

Simulators

iOS simulator builds: Build your app in Xcode targeting an iOS Simulator. Locate the .app file at Product > Show Build Folder in Finder > Products/Debug-iphonesimulator. Then compress it:
Or build from the command line:

Physical devices