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-emulatorbriq_run({ recipe: "android-emulator", wait: true })curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "android-emulator",
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "SANDBOX_HOST": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"stack: app
services:
sandbox:
recipe: android-emulator
# its defaults, each a field you can set:
# image: ghcr.io/briq-cloud/sandbox:kvm
# size: large
# volume: { gb: 40 }Fields
| Name | Type | Options | Default |
|---|---|---|---|
| image | string | — | "ghcr.io/briq-cloud/sandbox:kvm" |
| env | record | { key: string | { secret, value?, literal?, scope?, hosts?, locations? } } | {} |
| steps | object[] | — | — |
| cmd | string | string[] | — | — |
| size | enum | pico, micro, nano, small, medium, large, xlarge | "large" |
| volume | object | { gb? } | {"gb":40} |
| files | record | { 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
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| sandbox | ghcr.io/briq-cloud/sandbox:kvm | 8080 | large | 40 GB at /work |
When to use it
- Install an APK, drive it with
adband 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. largeby default (4 CPUs, 8 GB).mediumworks 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(defaultsystem-images;android-34;google_apis;x86_64). - arm64 apps run through the image's translation layer, slower than x86_64 apps.
- Long commands:
briq_execwithasync: true, thenbriq_exec_result. - Logs:
/work/emulator.log. Pro and Team plans.
3D sandbox
Blender, FreeCAD, CadQuery and OpenSCAD for creating 3D assets with scripts. Run Blender Python with briq_exec for meshes, materials, GLB and CPU renders; cad-python for dimensioned CAD and STEP/STL; freecad-python for FreeCAD documents; openscad for .scad models. Files stay in /work. CPU only; AutoCAD and native DWG tools are not included.
Desktop
A Chromium desktop for browser automation, with a shared screen to watch and control.