Android emulator

An Android emulator (Pixel 6, Android 14, x86_64) running in a sandbox: it is ready once Android has booted. Use `adb` through briq_exec: `adb install app.apk`, `adb shell input tap 100 200`, `adb exec-out screencap -p > /work/s.png`, then briq_files_get. The first start downloads the Android SDK and system image (5 GB) into /work/sdk, about 2 minutes; later starts take about 30 to 40 seconds. Default size large (4 CPUs, 8 GB); medium works. Pro and Team plans. The first start accepts the Android SDK License Agreement (https://developer.android.com/studio/terms).

  • sandbox
  • testing
  • android

Guide: Run an Android emulator

Run it

briq run android-emulator

Fields

NameTypeOptionsDefault
imagestring—"ghcr.io/briq-cloud/sandbox:kvm"
envrecord{ key: string | { secret, value?, literal?, scope?, hosts?, locations? } }{}
stepsobject[]——
cmdstring | string[]——
sizeenumpico, micro, nano, small, medium, large, xlarge"large"
volumeobject{ gb? }{"gb":40}
filesrecord{ key: string | { base64 } }—

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

SANDBOX_HOST
sandbox.<stack>.internal
WORKDIR
/work
PORT
8080

What it runs

BriqImagePortsSizeVolume
sandboxghcr.io/briq-cloud/sandbox:kvm8080large40 GB at /work

When to use it

  • Install an APK, drive it with adb and read the screen.
  • Test an Android app without a device or a desktop.
  • Anything the kvm-sandbox does, with Android booted.
briq_run({ recipe: "android-emulator" })

The run returns once Android has booted. Then:

briq_files_put({ ..., path: "/work/app.apk" })
briq_exec(["adb", "install", "/work/app.apk"])
briq_exec(["adb", "shell", "input", "tap", "540", "1200"])
briq_exec(["sh", "-c", "adb exec-out screencap -p > /work/s.png"])
briq_files_get({ ..., path: "/work/s.png" })

Tips

  • The first start takes about 2 minutes: it downloads the Android SDK and system image (5 GB) into /work/sdk. Later starts take about 30 to 40 seconds.
  • Licence: the first start accepts the Android SDK License Agreement.
  • Every start is a cold boot: the emulator keeps no state in memory. Apps and data stay on /work/avd.
  • large by default (4 CPUs, 8 GB). medium works with a smaller guest. The guest gets half the RAM, at most 4 GB, and all CPUs.
  • Change the guest in env: ANDROID_AVD_MEMORY (MB), ANDROID_AVD_CORES, ANDROID_SYSTEM_IMAGE (default system-images;android-34;google_apis;x86_64).
  • arm64 apps run through the image's translation layer, slower than x86_64 apps.
  • Long commands: briq_exec with async: true, then briq_exec_result.
  • Logs: /work/emulator.log. Pro and Team plans.

On this page

Free to try

Try briq, on us.

Every new account starts with €10 of credits. No card.

Start building

How can we help?

Message to the briq team