GithubHelp home page GithubHelp logo

irfanahmadin / android-emulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tracer0tong/android-emulator

0.0 1.0 0.0 21 KB

Yet another Docker container with Android SDK and Android emulator

License: Apache License 2.0

Makefile 51.65% Shell 48.35%

android-emulator's Introduction

Android-emulator

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.

Version

0.0.4

Tech

Installation

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 https://github.com/tracer0tong/android-emulator.git android-emulator
$ cd android-emulator
$ make run
$ make ports
Use:
adb kill-server
adb connect 172.17.0.2:32769
or
adb connect 0.0.0.0:32769
$ adb kill-server
$ adb connect 0.0.0.0:32769
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 0.0.0.0:32769
$ adb devices
List of devices attached
0.0.0.0:32769   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

or

$ 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   "/entrypoint.sh -e an"   6 days ago          Up 6 days           0.0.0.0:32812->22/tcp, 0.0.0.0:32811->5037/tcp, 0.0.0.0:32810->5554/tcp, 0.0.0.0:32809->5555/tcp, 0.0.0.0:32808->5900/tcp   android
$ ssh [email protected] -p 32812
[email protected]'s password:
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.19.0-28-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

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.

root@0dd15cd1bd43:~#

Makefile

Additional Makefile targets:

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

Todo's

  • 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

License

Apache

android-emulator's People

Contributors

tracer0tong avatar truongsinh avatar wseng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.