Skip to content
Spawndroid
Guide

Test every pull request on a real Android device

To test every pull request on a real Android device, add one GitHub Actions step that sends the PR's APK to Spawndroid. The app opens on Android for 30 seconds, and the pull request gets one comment saying whether it passed, crashed or stopped responding, with a recording and a link reviewers can open in the browser.

Run your APK freeUpdated

At a glance

Setup
One workflow file and one repository secret
Test code
None. Smoke mode opens the app and watches it
Cost per PR push
About 1 device-minute for a 30 second run
Result
Passed, Crashed, Not responding or Could not run

Summary

  • Commit a 10 line workflow and add SPAWNDROID_API_KEY as a secret.
  • Each push installs the PR's APK, opens the app for 30 seconds and taps it near the end.
  • One PR comment, edited in place: result, the exception and line if it crashed, the final screen, a recording link and a live link.
  • Crashes and ANRs fail the job. Could not run passes with a warning unless you ask it to fail.
  • Works on the free Hobby plan; a 30 second run uses about one device-minute.

The 10 line workflow

Create an API key with the upload scope under API & CI/CD, API keys, and add it as the repository secret SPAWNDROID_API_KEY. Then commit this as .github/workflows/spawndroid.yml:

on: pull_request
permissions: { contents: read, pull-requests: write }
jobs:
  device:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: ./gradlew assembleDebug
      - uses: spawndroid/cli@v0.3.1
        with: { api-key: "${{ secrets.SPAWNDROID_API_KEY }}", app: "app/build/outputs/apk/debug/*.apk" }

pull-requests: write is what lets the Action keep its comment on the pull request. If your build needs a specific JDK, add actions/setup-java before the Gradle step. If the build produces several APKs, for example with ABI splits, point app at the universal APK; a glob that matches more than one file is reported as Could not run.

What smoke mode does

Without a command input, the Action runs a smoke test instead of a suite. It uploads the APK, installs it on a fresh Android device, launches the app and keeps it open for 30 seconds. Eight seconds before the end it taps the app twice. A hung main thread does not show up on an idle screen, but it does show up when input arrives, so the taps turn a silent hang into an ANR that Android reports.

The device watches the app the whole time. A crash, the app closing on its own, or an ANR ends the run with that result. Going to the background still counts as running. Set smoke-seconds anywhere from 10 to 300 if your app needs longer to reach the interesting part.

The PR comment

There is one comment per pull request. Every push edits it in place, and results from earlier pushes fold into an Earlier pushes list, so the thread does not fill up with bot messages.

The Spawndroid comment on a GitHub pull request: Passed for app-universal-debug.apk at commit 5fc58e3, the app opened and stayed running for 30 seconds, Watch the recording, a 1:02 run, 1 device minute used, and the screen the run ended on
The comment the Action left on a real pull request, kl3jvi/sysinfo_app#14. Live preview was off because the repository is public.
ResultWhat it meansJob
PassedThe app opened, stayed running for the whole test and answered the taps.Passes
CrashedThe app crashed or closed. The comment names the exception and the line in your code, with the first log error folded underneath.Fails
Not respondingAndroid reported an ANR.Fails
FailedThe build would not install, for example an APK without arm64 libraries.Fails
Could not runNo device was free, the month's minutes are used up, or the workflow matched no single APK.Passes with a warning

Set fail-on-could-not-run: true if Could not run should fail the job.

Watch the recording opens a read-only run page with the result, the screen recording and the screen the run ended on. It opens without an account, shows only that run and expires after 30 days. Any workspace member can revoke it from the run. On a private repository the link stays off until a workspace admin turns on public run links for private repositories; until then the comment links to the run page in the console.

The read-only Spawndroid run page for a pull request smoke test: Passed, SysInfo on Android 14 phone, 1m 2s, the screen recording and the screen the run ended on
The read-only run page behind Watch the recording.

Try it live opens the same build on a device in the browser, so a reviewer can tap through the change without installing anything. It needs the Spawndroid GitHub App on the repository. Public repositories start with live previews off, because anyone who can see the pull request could spend the workspace's minutes; turn them on per repository on the Integrations page.

Several devices in one comment

A matrix over profile gives each leg its own section in the same comment:

strategy:
  matrix:
    profile: [android-14-phone, android-13-phone]
steps:
  - uses: spawndroid/cli@v0.3.1
    with:
      api-key: ${{ secrets.SPAWNDROID_API_KEY }}
      app: app/build/outputs/apk/debug/*.apk
      profile: ${{ matrix.profile }}

Each leg holds one runner while it runs. Hobby and Indie have one parallel runner, so the second leg waits for the first or reports Could not run; pass wait-for-runner to have it retry.

From smoke test to your own suite

Add command and the Action runs your Appium suite against the device instead of the smoke test. The comment keeps the same format. If the suite passes but the app crashed along the way, the result stays a pass and the comment adds a line saying the app crashed during the run.

- uses: spawndroid/cli@v0.3.1
  with:
    api-key: ${{ secrets.SPAWNDROID_API_KEY }}
    app: app/build/outputs/apk/debug/*.apk
    command: npx wdio run wdio.conf.mjs

Limits

  • Pull requests from forks get no secrets and a read-only token from GitHub. The Action writes a note to the job summary and passes; a maintainer can push the branch to the repository to test it.
  • Smoke mode proves the app opens and survives 30 seconds with input. It does not check that a screen shows the right thing.
  • Android 12 to 16 on ARM64 only. There is no iOS.
  • When the month's minutes are used up, the comment says so and the job stays green.

Frequently asked questions

No. Without a command input the Action runs a smoke test: it opens the app for 30 seconds, taps it near the end and reports a crash or ANR.

Keep reading

Start free

Put your next pull request on Android.

Create a workspace, add the secret and commit the workflow. Hobby includes 200 device-minutes a month and needs no card.