Giter Site home page Giter Site logo

docker-android's Introduction

docker-android

A Docker container that runs an Android Virtual Device (AVD).

Instructions

Build the container:

docker build -t android-test .

Allow Xhost access:

xhost +local:root

Start the container:

docker run --privileged -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix android-test

After terminating the container, forbid Xhost access:

xhost -local:root

Install and run an APK

When building your APK, make sure it supports the Android Version of your Virtual Device (currently Android 28). The requirements can be changed in the build.gradle of your application (look for android - defaultConfig - minSdkVersion).

Adapt the Dockerfile as follows:

  1. Add a copy instruction for your APK, e.g. COPY app-debug.apk ..
  2. Replace the last command in the Dockerfile by CMD bash.

Build and start the container, then do:

  1. Run tmux to open a new terminal.
  2. Run emulator -avd Android28 to start the AVD.
  3. Wait until the device is loaded, and leave thy terminal by pressing ctr (hold) + b, then d.
  4. run adb install app-debug.apk (replace with your apk file) to install the application.
  5. You can now use the application in the virtual device (search for it using the Google search bar of the phone).

docker-android's People

Contributors

hertelm avatar

Stargazers

 avatar  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.