android-16 template runs Android 16 inside an E2B Sandbox. Android (redroid, AOSP in a container) is booted when the template is built, so a new sandbox starts with Android already running, the screen on, and adb ready to drive it.
Use it when an agent or a test needs a real Android system: install an APK, tap through its UI, read the screen, and kill the sandbox afterwards.
Quickstart
Create a sandbox, check the Android version, open Settings, and save a screenshot locally.adb runs inside the sandbox, so every Android command goes through sandbox.commands.run().
Install and drive your app
Upload the APK into the sandbox with the filesystem API, install it withadb install, then launch it and interact with it. The -g flag grants the app’s runtime permissions at install, so no permission dialog covers the app on first launch.
adb commands an agent or test typically needs:
An agent can send the screenshot and the UI hierarchy to a model, then act on its answer with taps, swipes, and key events.
Pause and resume
By default, pausing saves the sandbox’s memory as well as its filesystem. When you resume it withconnect(), Android is still booted, installed apps are still installed, and the app that was in the foreground is still open. See Sandbox persistence for how pausing works.
What’s in the sandbox
- Android 16 (API level 36), an x86_64 AOSP image, running in a Docker container named
android. adbconnected to Android at127.0.0.1:5555.- A 720x1280 display at 320 dpi, rendered in software (SwiftShader). There is no GPU.
- 8 vCPUs and 4 GB of RAM, set by the template.
- The start script’s log at
/var/log/android-start.log. Android’s own log is inlogcat.
Known limitations
- No Google Play Services or Play Store. The image is plain AOSP, so apps that depend on Play Services, or that require the device to pass Play Integrity checks, do not work.
- x86_64 only. An app that ships native libraries needs x86_64 builds of them. An app that ships only arm64 native libraries installs, but fails when it loads those libraries.
- 64-bit only. The image supports no 32-bit ABIs.
- Software rendering. Graphics-heavy apps and games run slower than on a phone with a GPU.
- Use the template as is. Android does not start in a custom template built on
android-16, so its build fails. Install your apps at runtime withadb installinstead.