Pocket How
Xcode and tooling

Xcode Cloud vs GitHub Actions and fastlane for iOS CI

Xcode 26 and later, iOS and iPadOS apps. Intermediate. By Cihat Salik, .

Short answer

Xcode Cloud is the least setup for an app that lives in one Xcode project: Apple handles signing and TestFlight, and 25 compute hours a month come with the Developer Program. GitHub Actions on macOS runners gives full control at $0.062 per standard macOS minute. fastlane is the scripting layer that works on either, with match for shared signing.

What you’re actually choosing

“Should we use Xcode Cloud or GitHub Actions?” mixes up three separate decisions. Where do builds run: on Apple’s machines, on GitHub’s hosted Macs, or on a Mac you own? What drives the build: Xcode Cloud workflows, raw xcodebuild, or fastlane lanes? And how does code signing work on a machine nobody is logged into? Answer them separately and the right setup usually becomes obvious. fastlane in particular is a scripting layer that runs on either kind of machine.

Xcode Cloud

What it does well

Xcode Cloud is Apple’s hosted CI, configured from Xcode or App Store Connect. Workflows trigger on branch changes, pull requests, tags or a schedule, run build, test, analyze and archive actions, and can post builds straight to TestFlight. Signing is the big win. Apple’s setup guide asks you to turn on automatic signing, and Xcode Cloud handles certificates and profiles for you. There’s no keychain to create, no .p12 to rotate and no profile to download.

The requirements, from that guide:

  • Apple Developer Program membership and Xcode 15 or later.
  • An app record in App Store Connect, or the role to create one.
  • Shared schemes with the archive action enabled.
  • A Git repository on GitHub, GitLab or Bitbucket, cloud or self-hosted.
  • A consistent project or workspace that’s always present in the repository.

The last point matters more than it looks. Apple warns that a third-party tool that generates or edits your project dynamically can make configuration and builds fail. If your team generates the .xcodeproj with Tuist or XcodeGen and doesn’t commit it, Xcode Cloud is a poor fit unless you change that.

Customising with scripts

Xcode Cloud recognises exactly three scripts, placed at the top level of a ci_scripts folder next to your project, per Apple’s custom scripts guide:

  • ci_post_clone.sh runs after the clone, which is where you install tools.
  • ci_pre_xcodebuild.sh runs before xcodebuild.
  • ci_post_xcodebuild.sh runs after xcodebuild, even when it fails.

Make them executable, start them with a shebang, and remember the constraints: no sudo, files a script creates aren’t available to other scripts and get deleted, and the default shell is zsh. Predefined variables like CI_PULL_REQUEST_NUMBER and CI_PRODUCT_PLATFORM let one script branch by context. Mark secrets as secret environment variables and Xcode Cloud masks them in logs.

#!/bin/sh
set -e

if [ -n "$CI_PULL_REQUEST_NUMBER" ]; then
  echo "Pull request build"
fi

brew install swiftlint

Cost

From Apple’s Xcode Cloud page, Developer Program membership includes 25 compute hours per month. Paid plans, in US prices per month: 100 hours for $49.99, 250 hours for $99.99, 1,000 hours for $399.99 and 10,000 hours for $3,999.99. A compute hour is cloud time spent on a task, and parallel test runs add up: Apple’s example counts five 12-minute test runs as one compute hour. Usage is tracked per product and workflow in App Store Connect.

Where it falls short

You can’t SSH into a machine, cache arbitrary folders across runs, or run non-Apple jobs like an Android build or a web deploy. Script-based customisation is deliberately narrow. Teams with a monorepo, a generated project or a heavy custom pipeline usually outgrow it.

GitHub Actions on macOS runners

Runners and Xcode versions

GitHub hosts macOS runners you request by label. The runner images repository lists macos-latest, which points to macOS 26 on arm64, and macos-15 and macos-26 for pinned versions, plus larger -xlarge and -large variants. Each image ships several Xcode versions. Pin the Xcode version in your workflow with xcode-select rather than relying on the image default, because defaults change when GitHub updates the image and your build breaks for no reason you can see in your diff. Check the image’s README for the exact Xcode paths it includes.

jobs:
  build:
    runs-on: macos-26
    steps:
      - uses: actions/checkout@v4
      - name: Select Xcode
        run: sudo xcode-select -s "/Applications/Xcode_26.1.app"
      - name: Build
        run: |
          xcodebuild -scheme MyApp \
            -destination 'generic/platform=iOS Simulator' \
            -disableAutomaticPackageResolution \
            build

The Xcode path in that example is a placeholder; use one that the runner image actually lists. Apple’s CI guide for Swift packages recommends committing Package.resolved and passing -disableAutomaticPackageResolution, so CI always builds the package versions you tested. For private packages, use SSH URLs with a deploy key, or pass -scmProvider system so xcodebuild uses the machine’s own Git configuration.

Cost

From GitHub’s runner pricing page: standard macOS runners (3 or 4 cores) cost $0.062 per minute, the 12-core macOS runner $0.077, and the 5-core M2 Pro runner $0.102. Each job is rounded up to the whole minute. GitHub’s billing overview expresses included usage as a dollar amount instead of minutes: $12 a month on Free, $18 on Pro and Team, $300 on Enterprise Cloud. macOS minutes draw that amount down at the macOS rate, about ten times the Linux rate. Standard runners in public repositories are free, larger runners are billed even there, and self-hosted runners don’t consume included usage.

Comparing the numbers

A quick worked example using only the published prices. A 15-minute build on a standard GitHub macOS runner costs 15 × $0.062 = $0.93. On Xcode Cloud, the included 25 hours cover 100 builds of 15 minutes, and on the 100-hour plan each one works out to about $0.125. These numbers aren’t directly comparable, since the hardware differs and the same build won’t take the same time on both. Run your real build on each and compare what one build costs.

For a small team doing a few builds a day, Xcode Cloud’s included hours are hard to beat. For a team running full test suites on every push, the deciding factors are usually caching, concurrency and how much control you need.

Code signing outside Xcode Cloud

On your own runners you need a certificate and profiles on a machine with no logged-in user. There are three ways to do it.

1. Import a certificate and profile yourself

GitHub’s signing guide stores a base64 .p12, its password, a base64 provisioning profile and a keychain password as secrets. The job decodes them, creates a temporary keychain with security create-keychain, imports the certificate, runs security set-key-partition-list so codesign can use the key without a prompt, adds the keychain to the search list and copies the profile into ~/Library/MobileDevice/Provisioning Profiles. Hosted runners are destroyed after each job. On a self-hosted runner, add a final step that always runs and deletes the keychain and profile.

This works, but every certificate renewal means updating secrets by hand.

2. Automatic signing with an App Store Connect API key

Since Xcode 13, xcodebuild accepts an App Store Connect API key for automatic signing in headless environments. The Xcode 13 release notes name the parameters -authenticationKeyPath, -authenticationKeyID and -authenticationKeyIssuerID, used together with -allowProvisioningUpdates.

xcodebuild archive \
  -scheme MyApp \
  -archivePath "$RUNNER_TEMP/MyApp.xcarchive" \
  -destination 'generic/platform=iOS' \
  -allowProvisioningUpdates \
  -authenticationKeyPath "$RUNNER_TEMP/AuthKey.p8" \
  -authenticationKeyID "$ASC_KEY_ID" \
  -authenticationKeyIssuerID "$ASC_ISSUER_ID"

The same release notes describe cloud signing, where distribution certificates live on Apple’s servers and the private key never reaches your Mac. It’s available for App Store Connect, Ad Hoc, Enterprise and Developer ID distribution with automatic signing. This route needs the least maintenance, as long as the key’s role allows the signing operations it has to perform.

3. fastlane match

match keeps one set of certificates and profiles for the whole team in encrypted storage: a private Git repo by default, or Google Cloud or S3. Developers and CI fetch from the same place, and match repairs expired profiles. On CI, run it with readonly: true so a build machine never creates new certificates. For Git storage, MATCH_PASSWORD holds the decryption passphrase.

Pol Piella’s walkthrough of match splits the work into three lanes: one that generates identities once with readonly: false, one that team members run to sync, and a distribute lane for CI that calls setup_ci, syncs in read-only mode, then archives. He also recommends running match from a shared team Apple account whose email outlives any one employee. The setup_ci action creates a temporary keychain named fastlane_tmp_keychain and switches match to read-only mode. fastlane’s own GitHub Actions guide warns that skipping it can make the build hang, because match tries to write to the login keychain.

lane :beta do
  setup_ci if ENV["CI"]
  match(type: "appstore", readonly: true)
  build_app(scheme: "MyApp")
  upload_to_testflight(skip_waiting_for_build_processing: true)
end

match also accepts an App Store Connect API key through api_key_path, so CI doesn’t need an Apple ID with two-factor authentication. One limit from the docs: renewing Developer ID certificates through match still needs a username and password login.

Version and build numbers

Uploads fail when a build number has been used before. Pol Piella’s build number post reads the latest number with latest_testflight_build_number, adds one and applies it with increment_build_number. The marketing version comes from the release branch name, such as release/1.4.0, through increment_version_number. He commits the change back with [ci skip] in the message so the push doesn’t trigger another run, which requires CI to have write access. An alternative that avoids commits is to set CURRENT_PROJECT_VERSION at build time from the CI run number, as long as the counter only ever goes up.

Which to pick

Writers and teams disagree here mainly because they optimise for different things. Teams that value low maintenance pick Xcode Cloud, and teams that value control pick GitHub Actions with fastlane. This article’s recommendation is to choose by the shape of your project:

Situation Recommendation
One app, committed .xcodeproj, small team Xcode Cloud with TestFlight distribution
Generated project (Tuist, XcodeGen) not committed GitHub Actions or self-hosted
Android, web or backend jobs in the same repo GitHub Actions
Open-source package or app in a public repo GitHub Actions, free on standard runners
Heavy test suites, need caching between runs GitHub Actions or a self-hosted Mac
Many signing identities, several apps, a team fastlane match on whichever CI you use
Want the least signing maintenance outside Xcode Cloud xcodebuild with an App Store Connect API key

Traps

  • Unpinned Xcode. A runner image update changes the default Xcode and your build breaks on a Monday. Select the version explicitly.
  • Floating package versions. Without a committed Package.resolved, CI may resolve newer dependencies than you tested.
  • Keychain prompts. Any signing step that uses the login keychain on CI can hang waiting for a password. Use a temporary keychain.
  • Leaky self-hosted runners. Keychains and profiles persist between jobs unless you delete them.
  • Logging secrets. Never echo keys or tokens in scripts. Use the CI system’s secret masking.
  • Duplicate build numbers. Derive them from TestFlight or a monotonic counter, never from a hand-edited value.

Sources and further reading

Read next