{"title":"","byline":"budtmo","dir":null,"lang":null,"content":"

\n \n

\n

\"Paypal \"PRs \"codecov\" \"Join \"GitHub

\n

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

\n

Advantages of using this project

\n
    \n
  1. Emulator with different device profile and skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
  2. \n
  3. Support vnc to be able to see what happen inside docker container
  4. \n
  5. Support log sharing feature where all logs can be accessed from web-UI
  6. \n
  7. Ability to control emulator from outside container by using adb connect
  8. \n
  9. Integrated with other cloud solutions, e.g. Genymotion Cloud
  10. \n
  11. It can be used to build Android project
  12. \n
  13. It can be used to run unit and UI-Test with different test-frameworks, e.g. Appium, Espresso, etc.
  14. \n
\n

List of Docker-Images

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
AndroidAPIImage with latest release versionImage with specific release version
9.028budtmo/docker-android:emulator_9.0budtmo/docker-android:emulator_9.0_<release_version>
10.029budtmo/docker-android:emulator_10.0budtmo/docker-android:emulator_10.0_<release_version>
11.030budtmo/docker-android:emulator_11.0budtmo/docker-android:emulator_11.0_<release_version>
12.032budtmo/docker-android:emulator_12.0budtmo/docker-android:emulator_12.0_<release_version>
13.033budtmo/docker-android:emulator_13.0budtmo/docker-android:emulator_13.0_<release_version>
14.034budtmo/docker-android:emulator_14.0budtmo/docker-android:emulator_14.0_<release_version>
--budtmo/docker-android:genymotionbudtmo/docker-android:genymotion_<release_version>
\n

List of Devices

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TypeDevice Name
PhoneSamsung Galaxy S10
PhoneSamsung Galaxy S9
PhoneSamsung Galaxy S8
PhoneSamsung Galaxy S7 Edge
PhoneSamsung Galaxy S7
PhoneSamsung Galaxy S6
PhoneNexus 4
PhoneNexus 5
PhoneNexus One
PhoneNexus S
TabletNexus 7
\n

Requirements

\n
    \n
  1. Docker is installed on your system.
  2. \n
\n

Quick Start

\n
    \n
  1. \n

    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.

    \n
  2. \n
  3. \n

    Your machine should support virtualization. To check if the virtualization is enabled is:

    \n
    sudo apt install cpu-checker\nkvm-ok\n
    \n
  4. \n
  5. \n

    Run Docker-Android container

    \n
    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\n
    \n
  6. \n
  7. \n

    Open http://localhost:6080 to see inside running container.

    \n
  8. \n
  9. \n

    To check the status of the emulator

    \n
    docker exec -it android-container cat device_status\n
    \n
  10. \n
\n

Persisting data

\n

The default behaviour is to destroy the emulated device on container restart. To persist data, you need to mount a volume at /home/androidusr:\ndocker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0

\n

WSL2 Hardware acceleration (Windows 11 only)

\n

Credit goes to Guillaume - The Parallel Interface blog

\n

Microsoft - Advanced settings configuration in WSL

\n
    \n
  1. \n

    Add yourself to the kvm usergroup.

    \n
    sudo usermod -a -G kvm ${USER}\n
    \n
  2. \n
  3. \n

    Add necessary flags to /etc/wsl2.conf to their respective sections.

    \n
    [boot]\ncommand = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'\n\n[wsl2]\nnestedVirtualization=true\n
    \n
  4. \n
  5. \n

    Restart WSL2 via CMD prompt or Powershell

    \n\n
  6. \n
\n

command = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm' sets /dev/kvm to kvm usergroup rather than the default root usergroup on WSL2 startup.

\n

nestedVirtualization flag is only available to Windows 11.

\n

Use-Cases

\n
    \n
  1. Build Android project
  2. \n
  3. UI-Test with Appium
  4. \n
  5. Control Android emulator on host machine
  6. \n
  7. SMS Simulation
  8. \n
  9. Jenkins
  10. \n
  11. Deploying on cloud (Azure, AWS, GCP)
  12. \n
\n

Custom-Configurations

\n

This document contains information about configurations that can be used to enable some features, e.g. log-sharing, etc.

\n

Genymotion

\n

\n \n

\n

For you who do not have ressources to maintain the simulator or to buy machines or need different device profiles, you can give a try by using Genymotion SAAS. Docker-Android is integrated with Genymotion on different cloud services, e.g. Genymotion SAAS, AWS, GCP, Alibaba Cloud. Please follow this document for more detail.

\n

Emulator Skins

\n

The Emulator skins are taken from Android Studio IDE and Samsung Developer Website

\n

USERS

\n\n

\n \"docker-android-users\"\n

\n
\n

PRO VERSION

\n

Due to high requests for help and to be able to actively maintain the projects, the creator has decided to create docker-android-pro. Docker-Android-Pro is a sponsor based project which mean that the docker image of pro-version can be pulled only by active sponsor.

\n

The differences between normal version and pro version are:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FeatureNormalProComment
user-behavior-analyticsYesNo-
proxyNoYesSet up company proxy on Android emulator on fly
languageNoYesSet up language on Android emulator on fly
root-privilegedNoYesAble to run command with security privileged
headless-modeNoYesSave resources by using headless mode
Selenium 4.x integrationNoYesRunning Appium UI-Tests againt one (Selenium Hub) endpoint for Android- and iOS emulator(s) / device(s)
multiple Android-SimulatorsNoYes (soon)Save resources by having multiple Android-Simulators on one docker-container
Google Play StoreNoYes (soon)-
Video RecordingNoYes (soon)Helpful for debugging
\n

This document contains detail information about how to use docker-android-pro.

\n

LICENSE

\n

See License

\n
","textContent":"\n \n\n \nDocker-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).\nAdvantages of using this project\n\nEmulator with different device profile and skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.\nSupport vnc to be able to see what happen inside docker container\nSupport log sharing feature where all logs can be accessed from web-UI\nAbility to control emulator from outside container by using adb connect\nIntegrated with other cloud solutions, e.g. Genymotion Cloud\nIt can be used to build Android project\nIt can be used to run unit and UI-Test with different test-frameworks, e.g. Appium, Espresso, etc.\n\nList of Docker-Images\n\n\n\nAndroid\nAPI\nImage with latest release version\nImage with specific release version\n\n\n\n\n9.0\n28\nbudtmo/docker-android:emulator_9.0\nbudtmo/docker-android:emulator_9.0_\n\n\n10.0\n29\nbudtmo/docker-android:emulator_10.0\nbudtmo/docker-android:emulator_10.0_\n\n\n11.0\n30\nbudtmo/docker-android:emulator_11.0\nbudtmo/docker-android:emulator_11.0_\n\n\n12.0\n32\nbudtmo/docker-android:emulator_12.0\nbudtmo/docker-android:emulator_12.0_\n\n\n13.0\n33\nbudtmo/docker-android:emulator_13.0\nbudtmo/docker-android:emulator_13.0_\n\n\n14.0\n34\nbudtmo/docker-android:emulator_14.0\nbudtmo/docker-android:emulator_14.0_\n\n\n-\n-\nbudtmo/docker-android:genymotion\nbudtmo/docker-android:genymotion_\n\n\n\nList of Devices\n\n\n\nType\nDevice Name\n\n\n\n\nPhone\nSamsung Galaxy S10\n\n\nPhone\nSamsung Galaxy S9\n\n\nPhone\nSamsung Galaxy S8\n\n\nPhone\nSamsung Galaxy S7 Edge\n\n\nPhone\nSamsung Galaxy S7\n\n\nPhone\nSamsung Galaxy S6\n\n\nPhone\nNexus 4\n\n\nPhone\nNexus 5\n\n\nPhone\nNexus One\n\n\nPhone\nNexus S\n\n\nTablet\nNexus 7\n\n\n\nRequirements\n\nDocker is installed on your system.\n\nQuick Start\n\n\nIf 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.\n\n\nYour machine should support virtualization. To check if the virtualization is enabled is:\nsudo apt install cpu-checker\nkvm-ok\n\n\n\nRun Docker-Android container\ndocker 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\n\n\n\nOpen http://localhost:6080 to see inside running container.\n\n\nTo check the status of the emulator\ndocker exec -it android-container cat device_status\n\n\n\nPersisting data\nThe default behaviour is to destroy the emulated device on container restart. To persist data, you need to mount a volume at /home/androidusr:\ndocker run -v data:/home/androidusr budtmo/docker-android:emulator_11.0\nWSL2 Hardware acceleration (Windows 11 only)\nCredit goes to Guillaume - The Parallel Interface blog\nMicrosoft - Advanced settings configuration in WSL\n\n\nAdd yourself to the kvm usergroup.\nsudo usermod -a -G kvm ${USER}\n\n\n\nAdd necessary flags to /etc/wsl2.conf to their respective sections.\n[boot]\ncommand = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm'\n\n[wsl2]\nnestedVirtualization=true\n\n\n\nRestart WSL2 via CMD prompt or Powershell\n\n\n\ncommand = /bin/bash -c 'chown -v root:kvm /dev/kvm && chmod 660 /dev/kvm' sets /dev/kvm to kvm usergroup rather than the default root usergroup on WSL2 startup.\nnestedVirtualization flag is only available to Windows 11.\nUse-Cases\n\nBuild Android project\nUI-Test with Appium\nControl Android emulator on host machine\nSMS Simulation\nJenkins\nDeploying on cloud (Azure, AWS, GCP)\n\nCustom-Configurations\nThis document contains information about configurations that can be used to enable some features, e.g. log-sharing, etc.\nGenymotion\n\n \n\nFor you who do not have ressources to maintain the simulator or to buy machines or need different device profiles, you can give a try by using Genymotion SAAS. Docker-Android is integrated with Genymotion on different cloud services, e.g. Genymotion SAAS, AWS, GCP, Alibaba Cloud. Please follow this document for more detail.\nEmulator Skins\nThe Emulator skins are taken from Android Studio IDE and Samsung Developer Website\nUSERS\n\n \n \n \n\nPRO VERSION\nDue to high requests for help and to be able to actively maintain the projects, the creator has decided to create docker-android-pro. Docker-Android-Pro is a sponsor based project which mean that the docker image of pro-version can be pulled only by active sponsor.\nThe differences between normal version and pro version are:\n\n\n\nFeature\nNormal\nPro\nComment\n\n\n\n\nuser-behavior-analytics\nYes\nNo\n-\n\n\nproxy\nNo\nYes\nSet up company proxy on Android emulator on fly\n\n\nlanguage\nNo\nYes\nSet up language on Android emulator on fly\n\n\nroot-privileged\nNo\nYes\nAble to run command with security privileged\n\n\nheadless-mode\nNo\nYes\nSave resources by using headless mode\n\n\nSelenium 4.x integration\nNo\nYes\nRunning Appium UI-Tests againt one (Selenium Hub) endpoint for Android- and iOS emulator(s) / device(s)\n\n\nmultiple Android-Simulators\nNo\nYes (soon)\nSave resources by having multiple Android-Simulators on one docker-container\n\n\nGoogle Play Store\nNo\nYes (soon)\n-\n\n\nVideo Recording\nNo\nYes (soon)\nHelpful for debugging\n\n\n\nThis document contains detail information about how to use docker-android-pro.\nLICENSE\nSee License\n","length":5359,"excerpt":"","siteName":null}