Docker-Android is a docker image built to be used for everything related to Android. It can be used for Application development and testing (native, web and hybrid-app).
Advantages of using this project
- Emulator with different device profile and skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
- Support vnc to be able to see what happen inside docker container
- Support log sharing feature where all logs can be accessed from web-UI
- Ability to control emulator from outside container by using adb connect
- Integrated with other cloud solutions, e.g. Genymotion Cloud
- It can be used to build Android project
- It can be used to run unit and UI-Test with different test-frameworks, e.g. Appium, Espresso, etc.
List of Docker-Images
| Android | API | Image with latest release version | Image with specific release version |
|---|---|---|---|
| 9.0 | 28 | budtmo/docker-android:emulator_9.0 | budtmo/docker-android:emulator_9.0_ |
| 10.0 | 29 | budtmo/docker-android:emulator_10.0 | budtmo/docker-android:emulator_10.0_ |
| 11.0 | 30 | budtmo/docker-android:emulator_11.0 | budtmo/docker-android:emulator_11.0_ |
| 12.0 | 32 | budtmo/docker-android:emulator_12.0 | budtmo/docker-android:emulator_12.0_ |
| 13.0 | 33 | budtmo/docker-android:emulator_13.0 | budtmo/docker-android:emulator_13.0_ |
| 14.0 | 34 | budtmo/docker-android:emulator_14.0 | budtmo/docker-android:emulator_14.0_ |
| - | - | budtmo/docker-android:genymotion | budtmo/docker-android:genymotion_ |
List of Devices
| Type | Device Name |
|---|---|
| Phone | Samsung Galaxy S10 |
| Phone | Samsung Galaxy S9 |
| Phone | Samsung Galaxy S8 |
| Phone | Samsung Galaxy S7 Edge |
| Phone | Samsung Galaxy S7 |
| Phone | Samsung Galaxy S6 |
| Phone | Nexus 4 |
| Phone | Nexus 5 |
| Phone | Nexus One |
| Phone | Nexus S |
| Tablet | Nexus 7 |
| Tablet | Pixel C |
Requirements
- Docker is installed on your system.
Quick Start
-
If you use Ubuntu OS on your host machine, you can skip this step. For OSX and Windows OS user, you need to use Virtual Machine that support Virtualization with Ubuntu OS because the image can be run under Ubuntu OS only.
-
Your machine should support virtualization. To check if the virtualization is enabled is:
sudo apt install cpu-checker
kvm-ok -
Run Docker-Android container
docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0 -
Open http://localhost:6080 to see inside running container.
-
To check the status of the emulator
docker exec -it android-container cat device_status
Persisting data
The default behaviour is to destroy the emulated device on container restart. To persist data, you need to mount a volume at /home/androidusr:
docker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0
WSL2 Hardware acceleration (Windows 11 only)
Credit goes to Guillaume - The Parallel Interface blog
Microsoft - Advanced settings configuration in WSL
-
Add yourself to the
kvmusergroup.sudo usermod -a -G kvm ${USER} -
Add necessary flags to
/etc/wsl2.confto their respective sections.[boot]
command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'
[wsl2]
nestedVirtualization=true