Skip to content
Automation

Upload APKs from CI

Use a scoped API key to upload a build from GitHub Actions, GitLab, or any shell.

Updated 12 October 20264 min read

The console is convenient, but the best place to upload is your pipeline. Create an API key once and POST the APK from anywhere, every build lands in your workspace ready to run.

Create an API key

In API & CI/CD → API keys, create a key with the upload scope. The secret is shown once; store it as a CI secret (for example, GitHub Actions → Settings → Secrets).

Upload with curl

Upload in three calls: reserve a slot, send the bytes to storage, then register them. A single multipart POST to /api/apps is capped at about 4.5 MB by the host, so a real APK gets a 413. npx spawndroid upload does the same three steps for you.

APK=app/build/outputs/apk/release/app-release.apk
API=https://app.spawndroid.io
AUTH="Authorization: Bearer $SPAWNDROID_API_KEY"
# Reserve a slot, PUT the bytes straight to storage, then register them.
SLOT=$(curl -fsS -X POST "$API/api/apps/presign" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -d "{\"filename\": \"app-release.apk\", \"size\": $(wc -c < "$APK")}")
curl -fsS -X PUT "$(jq -r .url <<<"$SLOT")" \
  -H "Content-Type: $(jq -r .contentType <<<"$SLOT")" \
  --data-binary @"$APK"
curl -fsS -X POST "$API/api/apps" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -d "{\"key\": \"$(jq -r .key <<<"$SLOT")\", \"filename\": \"app-release.apk\"}"

The response includes the build's id, its slug and the decoded manifest. Keep the id, that is what a hosted Appium runner installs.

GitHub Actions

name: Upload build
on: pull_request
jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build APK
        run: ./gradlew assembleRelease
      - name: Upload to SpawnDroid
        env:
          SPAWNDROID_API_KEY: ${{ secrets.SPAWNDROID_API_KEY }}
        run: |
          npx --yes spawndroid@0.1.8 upload app/build/outputs/apk/release/app-release.apk

Uploads from CI don't auto launch

A dashboard upload boots a device immediately; a CI upload only stores the build, so a pipeline can push many builds without holding devices open. When you are ready to test, start a runner, see Run Appium tests in CI.

Start free

Put your next build on real Android.

Upload an APK, run it by hand, or hand it to Appium. The Hobby plan includes one parallel runner and 200 device-minutes a month, and needs no card.