Skip to main content

Currently supported use cases for the iOS platform

We have prepared some Pipeline recipes based on common iOS use cases. These contain some of the most frequent tasks our users need to run.

(iOS) Run tests in parallel on multiple simulatorsClick to copy link

DescriptionClick to copy link

This example uses the sample-swift-project-with-parallel-ui-test iOS Open Source sample app, which has some example Unit and UI tests and uses Test Plans to group the tests.

The example Pipeline config showcases how to run all the test cases of the project on different iOS simulators.

run_tests_on_simulators Pipeline runs two Stages sequentially:

  1. build_tests stage that runs the build_tests Workflow. This Workflow git clones the sample project and runs the xcode-build-for-test Step to build the target and associated tests. The built test bundle is transferred to the next Stage (run_tests_on_simulators) via the deploy-to-bitrise-io Step.

    The build test bundle is compressed

    xcode-build-for-test Step compresses the built test bundle and moves the generated zip to the $BITRISE_DEPLOY_DIR. That directory’s content is deployed to the Workflow artifacts by default via the deploy-to-bitrise-io Step.

    Artifact file size limitation

    There is no limitation on the number of files deployed to Artifacts per build. There is a limitation, however, on the file size which is 2GB per file.

  2. run_tests_on_simulators Stage runs three Workflows in parallel: run_tests_iPad, run_tests_iPhone, and run_tests_iPod. Both of these Workflows use the new xcode-test-without-building Step, which executes the tests based on the previous stage built test bundle. The pre-built test bundle is pulled by the _pull_test_bundleutility Workflow.

    iOS_example_modified.png

InstructionsClick to copy link

To test the configuration in a new Bitrise example project, do the following:

  1. Visit the Create New App page to create a new App.
  2. When prompted to select a git repository, choose Other/Manual and paste the sample project repository URL (https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test) in the Git repository (clone) URL field.
  3. Confirm that this is a public repository in the resulting pop-up.
  4. Select the master branch to scan.
  5. Wait for the project scanner to complete.
  6. Select any of the offered Distribution methods (for example development, it does not really matter as now we are focusing on testing).
  7. Confirm the offered stack, skip choosing the app icon and the webhook registration and kick off the first build.
  8. Open the new Bitrise project’s Workflow Editor.
  9. Go to the bitrise.yml tab and replace the existing bitrise.yml with the contents of the example [bitrise.yml](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-tests-in-parallel-on-multiple-simulators.md#bitriseyml) file.
  10. Click the Start/Schedule a Build button, and select the run_tests_on_simulators option in the “Workflow, Pipeline” dropdown menu at the bottom of the popup.

bitrise.ymlClick to copy link

GitHub link: https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-tests-in-parallel-on-multiple-simulators.md#bitriseyml

(iOS) Run test groups in parallelClick to copy link

DescriptionClick to copy link

This example uses the sample-swift-project-with-parallel-ui-test iOS Open Source sample app, which has some example Unit and UI tests and uses Test Plans to group the tests.

XCode test plans

Xcode Test Plans provide a way to run a collection of tests with different test configurations. raywenderlich.com has a great tutorial on how to get started with Xcode Test Plans.

The example Pipeline config showcases how to run different test groups in parallel.

run_tests_groups Pipeline runs two Stages sequentially:

  1. build_tests Stage that runs the build_tests Workflow. This Workflow git clones the sample project and runs the xcode-build-for-test Step to build the target and associated tests. The built test bundle is transferred to the next Stage (run_tests_groups) via the deploy-to-bitrise-io Step.

  2. run_tests_groups Stage runs two Workflows in parallel: run_ui_tests and run_unit_tests. Both of these Workflows use the new xcode-test-without-building Step, which executes the tests based on the previous Stage built test bundle. The pre-built test bundle is pulled by the _pull_test_bundle utility Workflow.

    iOS_example_2.png

InstructionsClick to copy link

  1. Visit the Create New App page to create a new App.
  2. When prompted to select a git repository, choose Other/Manual and paste the sample project repository URL (https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test) in the Git repository (clone) URL field.
  3. Confirm that this is a public repository in the resulting pop-up.
  4. Select the master branch to scan.
  5. Wait for the project scanner to complete.
  6. Select any of the offered Distribution methods (for example development, it does not really matter as now we are focusing on testing).
  7. Confirm the offered stack, skip choosing the app icon and the webhook registration and kick off the first build.
  8. Open the new Bitrise project’s Workflow Editor.
  9. Go to the bitrise.yml tab and replace the existing bitrise.yml with the contents of the example [bitrise.yml](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-test-groups-in-parallel.md#bitriseyml) file.
  10. Click the Start/Schedule a Build button, and select the run_tests_groups option in the “Workflow, Pipeline” dropdown menu at the bottom of the popup.

bitrise.ymlClick to copy link

GitHub link: https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-test-groups-in-parallel.md#bitriseyml