Getting started with Mobile Delivery Cloud

👋 Welcome to Buildkite Mobile Delivery Cloud! You can use Mobile Delivery Cloud to help you run CI/CD pipelines to build your mobile apps, and track and analyze automated tests, as well as house your built mobile app artifacts within appropriate registries, all within a matter of steps.

This getting started page is a tutorial that helps you understand Mobile Delivery Cloud's fundamentals, by guiding you through the process of setting up Buildkite Mac hosted agents to run a Buildkite pipeline that creates a basic iOS app for deployment.

Before you start

To complete this tutorial, you'll need:

  • A Buildkite account. If you don't have one already, create a 30-day free trial account.

    When you create a new organization as part of sign-up, you'll be guided through a flow to create and run a starter pipeline. Complete that before continuing.

  • To enable the YAML steps editor in Buildkite:

    • Select Settings > YAML Migration to open the YAML migration settings.
    • Select Use YAML Steps for New Pipelines, then confirm the action in the modal.
  • Git. This tutorial uses GitHub, but Buildkite can work with any version control system.

Set up your hosted agent

An agent is a small, reliable, and cross-platform program that runs pipeline builds. The agent polls Buildkite for work, runs jobs, and reports results.

Mobile Delivery Cloud uses Buildkite hosted agents running macOS on Mac machines, which are configured through a cluster. Clusters provide a mechanism to organize your pipelines and agents together, such that the pipelines associated with a given cluster can only be built by the agents (defined within queues) in the same cluster.

By default, Buildkite organizations have one cluster, named Default cluster with a single self-hosted queue, named default-queue, noting that a cluster maintainer or Buildkite organization administrator can customize these default names.

You need at least one Buildkite hosted agent queue configured to run a build.

Create a Buildkite hosted agent for Mac

You can create the first Buildkite hosted agent for Mac within a Buildkite organization for a two-week free trial, after which a usage cost (based on the agent's capacity) is charged per minute.

To create your Mac hosted agent:

  1. Navigate to the cluster you want to run your pipeline in. To do this, select Agents in the global navigation to access the Clusters page.
  2. Select the cluster (for example, Default cluster) to which the hosted agent will be added.
  3. Follow the Create a queue > Using the Buildkite interface instructions to begin creating your hosted agent within its own queue.

    As part of this process:

    • Give this queue an intuitive key and description, for example, buildkite-macos-hosted-queue and Buildkite macOS hosted queue, respectively.
    • In the Select your agent infrastructure section, select Hosted.
    • Select macOS as the Machine type and Small for the Capacity. Larger capacity machines allow your pipelines to run faster, since these pipelines typically execute device emulators, which can be computationally intensive, as part of the build process.
  4. Make your pipelines use your new Mac hosted agent by default, by ensuring its queue is the default queue. This should be indicated by (default) after the queue's key on the cluster's Queues page. If this is not the case and another queue is marked (default):

    1. On the cluster's Queues page, select the queue with the hosted agent you just created.
    2. On the queue's Overview page, select the Settings tab to open this page.
    3. In the Queue Management section, select Set as Default Queue.

Your Buildkite Mac hosted agent, as the new default queue, is now ready to use.

Create a pipeline

Pipelines are how Buildkite represents a CI/CD workflow. You define each pipeline with a series of steps to run. When you trigger a pipeline, you create a build, and steps are dispatched as jobs to run on agents, such as the Mac agent you just created. Jobs are independent of each other and can run on different Mac agents.

Next, you'll create a new pipeline to build the example FlappyKite Swift application (app). This simple example of a mobile app starts with an initial blank screen, and a plus (+) button at its top. Each time you tap this button, a new timestamp is generated successively down the screen.

The source code for this app contains the Buildkite pipeline in its .buildkite folder. This pipeline:

  • Runs two iOS emulators (one each for the iPhone 16 and 16 Pro models) to test the app, which in turn, takes screenshots of the app after the + button is tapped a few times as part of a UI test.
  • Leverages fastlane to automate deployments and releases. Learn more about fastlane from the fastlane documentation.

To create the new Buildkite pipeline for this app:

  1. Add a new pipeline in your Buildkite organization, using https://github.com/buildkite/FlappyKite.git as the Git Repository value.
  2. On the New Pipeline page, select the cluster you created the hosted agent for Mac in.
  3. Leave all other fields with their pre-filled default values and select Create Pipeline. This associates the example repository with your new pipeline, and adds a step to upload the full pipeline definition from the repository.
  4. On the next page showing your pipeline name, click New Build. In the modal that opens, create a build using the pre-filled details.

    1. In the Message field, enter a short description for the build. For example, My first build.
    2. Select Create Build.
  5. After a few minutes, and when the pipeline has completed its build, expand the screenshots job.

  6. Select the Artifacts tab to reveal the two screenshots taken (one from each iOS emulator) after the UI tests 'tap' the + button three times.

  7. Select each screenshot to view the results, such as the following from the main screen of the app run by the pipeline in an iPhone 16 Pro emulator.

Screenshot from the main screen of an iPhone 16 Pro