DEV Community

Cover image for How to Run Maestro Tests on Android and iOS in GitHub Actions
Mayvin Ramasawmy
Mayvin Ramasawmy

Posted on

How to Run Maestro Tests on Android and iOS in GitHub Actions

Maestro flows that only run on your laptop protect only you. If a teammate's pull request breaks the login screen and nobody runs the suite before merging, you find out from a user.

GitHub Actions can run those flows on every pull request on GitHub-hosted runners. You don't need a device farm, a Maestro Cloud account or an API key. Linux runners can start an Android emulator once KVM is enabled and macOS runners come with Xcode and iOS simulators already installed. Maestro's own repository tests itself this way.

What the guide covers:

  • 🤖 Two complete workflows: maestro-android.yaml on ubuntu-latest and maestro-ios.yaml on macos-latest
  • 🏷️ Running smoke-tagged flows on pull requests and regression flows on a nightly cron schedule
  • 📸 Using --format junit and --test-output-dir to upload the JUnit report and the screenshot from the step that failed
  • 🔐 Seeding test data with a pre-Maestro script and GitHub secrets
  • ⏱️ Measured run times: about 2 minutes on Android and about 10 minutes on iOS for one smoke flow
  • 🧱 What --shard-split does, and where one runner stops being enough

One detail from the guide: the workflows pick tags with a GitHub expression, github.event_name == 'schedule' && '--include-tags=regression' || '--include-tags=smoke'. If you swap the nightly value for '' to mean "run everything", it stops working. GitHub treats an empty string as false, so the || branch wins and your nightly run quietly falls back to the smoke tests. The job still passes just with one flow instead of four.

The full guide also covers the Android arch default that can stop the emulator from booting and why xcrun simctl bootstatus -b is a safer way to boot the iOS simulator than xcrun simctl boot.

👉 Read the full guide here: https://www.mobile-automation.io/maestro-github-actions-ci/


I write practical guides on mobile test automation and AI tooling at mobile-automation.io. If this was useful, feel free to follow along.

Top comments (0)