Public | Automated Build

Last pushed: a year ago
Short Description
This is a Docker container for fast deployment of Android emulators. Send issues via GitHub.
Full Description


Thanks to @nightscape for nice optimizations!

Android-emulator is yet another Docker image with Android SDK and emulator inside (based on tons of other works).

My aims:

  • Make stable and reliable Docker container
  • Put some tools for static analysis inside
  • Implement useful commands to Makefile

Docker image avalaible from Docker registry.





Use Docker registry with latest tag:

$ docker pull tracer0tong/android-emulator:latest
$ docker run -d -P --name android tracer0tong/android-emulator

Or use Makefile from repository:

$ git clone android-emulator
$ cd android-emulator
$ make run
$ make ports
adb kill-server
adb connect
adb connect
$ adb kill-server
$ adb connect
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to
$ adb devices
List of devices attached   device

$ adb shell
root@generic_x86:/ #

By default it will create and run API 19 (arm) for you, but some other versions also supported. You can run emulator for API versions: 19, 21, 22 x86/armeabi-v7a (as -a option). This is the most popular API versions among usable devices.

$ make EMULATOR="android-22" ARCH="x86" run


$ docker run -e "EMULATOR=android-22" -e "ARCH=x86" -d -P --name android tracer0tong/android-emulator

How to connect to emulator

Emulator container exposed 4 port's by default:
tcp/22 - SSH connection to container (login: root, password: android, change this if you are security concerned)

  • tcp/5037 - ADB
  • tcp/5554 - ADB
  • tcp/5555 - ADB connection port
  • tcp/5900 - QEMU VNC connection (doesn't support pointing device and keyboard, I recommend to use MonkeyRunner for pointing simulation or 3rd-party VNC server pushed into emulator)

Q: How to understand, which ip address use to connect?

A: Depend on Docker toolset: for GUI tools as Kitematic just check port forwardind settings on container home page. If you are using Docker under Linux environment, just use docker ps command.

$ sudo docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                                                                                                       NAMES
0dd15cd1bd43        tracer0tong/android-emulator   "/ -e an"   6 days ago          Up 6 days >22/tcp,>5037/tcp,>5554/tcp,>5555/tcp,>5900/tcp   android
$ ssh root@ -p 32812
root@'s password:
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.19.0-28-generic x86_64)

 * Documentation:

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.



Additional Makefile targets:

$ make kill
$ make ps
$ make ports
$ make clean


  • Add new targets to Makefile (create new AVD, update sdk etc.)
  • Optimize Dockerfile
  • Provide options for emulator, port redirection, etc.
  • Add androguard, drozer etc. to image



Docker Pull Command
Source Repository

Comments (14)
9 months ago

I'd recommend to create issues in Github, because I'm usually have no time to read comments here :(

9 months ago

I am creating my own docker image based on yours to try and run my android tests. So far I just want to get it started and just made a Dockerfile based on yours which replaces the file with my own. At the moment my entrypoint/sh file looks exactly the same as yours.

When I run the docker command without -d, I can see that it gets stuck at the next line in the logs:

emulator: ping command: /usr/local/android-sdk/tools/ddms ping emulator "" "" ""

What is wrong?

9 months ago

Password in Dockerfile ROOTPASSWORD variable and this is a ... BINGO SOUND ... "android".

9 months ago

What is the password

a year ago

@xiang19890319 I've used OpenVNC

a year ago

I tried to connect the emulator with tight VNC, but I can not do anything, which 3rd part VNC you will recommend?

a year ago

Hi Cristopher! I'm glad that my code helps you. As usual I'm ready to accept any bug reports and suggestions on Github.

a year ago

Hey tracer0tong, I've used yours as base of my own image; fix some bugs that I had with android packages and finally I added appium. You can check out what I did in cristopherdcb/appium-android. My idea improve appium part and probably try to reduce image size using alpine linux

a year ago

I'm strongly recommend to send me pull requests and issues on Github, because it's very difficult to check many places with comments.

a year ago

Perhaps Makefile needs to be fixed. It is not self-evident that 'run' target invokes 'clean' and it force-removes ALL (even unrelated) docker containers in the system.