Mobile CI/CD with EAS, Fastlane & Codemagic

Automate linting, tests, builds, signing and store uploads on every merge using EAS Workflows, Fastlane, Codemagic, Bitrise or GitHub Actions.

Intermediate · about 6 hours · difficulty 3/5

Learn first: Build Variants & Code Signing, Unit Testing App Logic

Manually building and uploading apps from a laptop does not scale and is error-prone. Mobile CI/CD automates the path from a merged pull request to a build in testers' hands.

A typical pipeline

  1. On every pull request: install dependencies, type check, lint, run unit and component tests.
  2. On merge to main: build signed staging binaries and distribute them to internal testers.
  3. On a release tag: build production binaries, upload to TestFlight and the Play internal track, and optionally submit for review.
  4. Optionally: run E2E tests against the built app and publish an OTA update for JS-only changes.

Tooling options

  • EAS Build, Submit and Workflows: the natural fit for Expo apps, with cloud macOS builders and managed credentials.
  • Fastlane: Ruby-based automation of builds, signing (match), screenshots and uploads (pilot, supply). Works with any stack.
  • Codemagic: hosted CI with first-class Flutter support and macOS machines.
  • Bitrise and GitHub Actions (with macOS runners) are also common.
# GitHub Actions step for an Expo app
- run: npx eas-cli build --platform all --profile production --non-interactive
  env:
    EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}

Mobile-specific concerns

  • iOS builds need macOS; cloud builders avoid maintaining Macs.
  • Store signing material as encrypted CI secrets, never in the repository.
  • Auto-increment build numbers from CI.
  • Cache dependencies (node_modules, Gradle, CocoaPods, pub) to keep builds fast.
  • Builds are slow and cost money, so run full native builds only when needed.

Good enough to move on: merging to main automatically produces a signed build that testers can install, with tests gating the pipeline.

Key concepts

  • Pipeline stages for mobile
  • EAS Build, Submit and Workflows: Expo
  • Fastlane lanes and match
  • Codemagic for Flutter
  • GitHub Actions with macOS runners
  • Secrets and signing in CI
  • Automatic build numbers
  • Caching dependencies

Mini project

Create a pipeline where every PR runs tests, every merge to main builds and distributes a staging app, and every git tag submits production builds to TestFlight and the Play internal track.

Check yourself

Why do iOS builds usually need a macOS runner, and how do cloud build services help small teams?

Free resources