Android in docker solution with noVNC supported and video recording
Find a file
Budi Utomo 0ab0eaffcf
Typo
2018-11-19 10:53:53 +01:00
.github Added GitHub templates 2018-02-17 09:59:09 +01:00
aks-terraform Kompose/volumes.yaml deleted 2018-10-12 18:17:12 -05:00
devices Enable Samsung Galaxy S6 2017-03-16 16:33:26 +01:00
docker Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00
example Refactored 2017-06-02 15:30:51 +02:00
genymotion Corrected the example of json file for Genymotion on AWS 2018-11-15 15:02:29 +01:00
images Added demo how to use Genymotion cloud 2018-06-25 23:53:06 +02:00
sm Automated some steps in screen mirroring for real device 2018-02-12 18:09:14 +01:00
src Enabled custom security group 2018-11-14 13:56:41 +01:00
.gitattributes Cleaned up 2018-06-22 02:32:01 +02:00
.gitignore Cleaned up 2018-06-22 02:32:01 +02:00
.travis.yml Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00
Analytics.md Updated lines 2018-11-09 15:58:36 +01:00
docker-compose.yml Updated version of Selenium Grid in examples 2018-09-03 10:28:58 +02:00
docker.tf Formatted 2018-09-27 15:13:46 +02:00
LICENSE.md Added header 2018-10-26 15:18:27 +02:00
MAINTAINERS First commit 2016-12-22 14:29:57 +01:00
README.md Modified file type 2018-10-26 15:05:14 +02:00
README_APPIUM_AND_SELENIUM.md Cleaned up 2018-09-04 12:01:47 +02:00
README_CLOUD.md Add a bit more verbosity 2018-10-05 14:47:17 -04:00
README_CUSTOM_CONFIG.md Typo 2018-11-19 10:53:53 +01:00
README_GENYMOTION.md update genymotion readme file 2018-09-13 17:46:14 +02:00
README_VMWARE.md Cleaned up 2018-09-04 12:01:47 +02:00
release.sh Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00
release_geny.sh Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00
release_real.sh Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00
requirements.txt Downgraded selenium to be able to run E2E Tests 2017-06-02 16:55:51 +02:00
revert.sh Added script to revert a release 2018-05-29 00:09:28 +02:00
setup.cfg Refactored code, added log and emulator skins 2017-02-27 14:53:48 +01:00
supervisord.conf Update Google Play Services and some other useful stuff by adb 2018-07-28 16:53:26 +04:30
travis.sh Added google analytics and automation script for Genymotion 2018-10-26 15:00:46 +02:00

Analytics Join the chat at https://gitter.im/butomo1989/docker-android Build Status codecov Codacy Badge

Docker-Android is a docker image built to be used for everything related to mobile website testing and Android project.

Appium Conference 2018

Emulator - Samsung Device Emulator - Nexus Device Real Device

Purposes

  1. Run UI tests for mobile websites with appium
  2. Build Android project and run unit tests with the latest build-tools
  3. Run UI tests for Android applications with different frameworks (appium, espresso, robotium, etc.)
  4. Run monkey / stress tests
  5. SMS testing

Advantages compare with other docker-android projects

  1. noVNC to see what happen inside docker container
  2. Emulator for different devices / skins, such as Samsung Galaxy S6, LG Nexus 4, HTC Nexus One and more.
  3. Ability to connect to Selenium Grid
  4. Ability to control emulator from outside container by using adb connect
  5. Support real devices with screen mirroring
  6. Ability to record video during test execution for debugging
  7. Integrated with other cloud solutions, e.g. Genymotion Cloud
  8. Open source with more features coming

List of Docker images

OS Android API Browser Browser version Chromedriver Image Size
Linux 5.0.1 21 browser 37.0 2.21 butomo1989/docker-android-x86-5.0.1
Linux 5.1.1 22 browser 39.0 2.13 butomo1989/docker-android-x86-5.1.1
Linux 6.0 23 browser 44.0 2.18 butomo1989/docker-android-x86-6.0
Linux 7.0 24 chrome 51.0 2.23 butomo1989/docker-android-x86-7.0
Linux 7.1.1 25 chrome 55.0 2.28 butomo1989/docker-android-x86-7.1.1
Linux 8.0 26 chrome 58.0 2.31 butomo1989/docker-android-x86-8.0
Linux 8.1 27 chrome 61.0 2.33 butomo1989/docker-android-x86-8.1
Linux 9.0 28 chrome 66.0 2.40 butomo1989/docker-android-x86-9.0
All - - - - - butomo1989/docker-android-real-device
Linux All All All All All butomo1989/docker-android-genymotion

List of Devices

Type Device Name
Phone Samsung Galaxy S6
Phone Nexus 4
Phone Nexus 5
Phone Nexus One
Phone Nexus S
Tablet Nexus 7

Requirements

Docker is installed in your system.

Quick Start

  1. Run Docker-Android

    • For Linux OS, please use image name that contains "x86"

      docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container butomo1989/docker-android-x86-8.1
      
    • For OSX and Windows OS, please use Virtual Machine that support Virtualization with Ubuntu OS

  2. Verify the ip address of docker host.

    • For OSX, you can find out by using following command:

      docker-machine ip default
      
    • For different OS, localhost should work.

  3. Open http://docker-host-ip-address:6080 from web browser.

Custom configurations

This document contains custom configurations of Docker-Android that you might need, e.g. Proxy, Changing language on fly, etc.

Build Android project

Docker-Android can be used for building Android project and executing its unit test. This following steps will illustrate how to build Android project:

  1. Clone this sample test project.

    git clone git@github.com:googlesamples/android-testing.git
    
  2. Build the project

    docker run -it --rm -v $PWD/android-testing/ui/espresso/BasicSample:/root/tmp butomo1989/docker-android-x86-8.1 tmp/gradlew build
    

Appium and Selenium Grid

If you want to use Appium and Selenium Grid, you can follow this document. It also contains sample and use cases.

Control android emulator outside container

adb connect <docker-machine-ip-address>:5555

Note: You need to have Android Debug Bridge (adb) installed in your host machine.

SMS Simulation

  1. Using telnet

    • Find the auth_token and copy it.
    docker exec -it android-container cat /root/.emulator_console_auth_token
    
    • Access emulator using telnet and login with auth_token
    telnet <docker-machine-ip-address> 5554
    
    • Login with given auth_token from 1.step
    auth <auth_token>
    
    • Send the sms
    sms send <phone_number> <message>
    
  2. Using adb

    docker exec -it android-container adb emu sms send <phone_number> <message>
    
  3. You can also integrate it inside project using adb library.

Google Play Services and Google Play Store

Docker-Android contains Google Play Service (v12.8.74) and Google Play Store (v11.0.50). Both applications are downloaded from apklinker, so please be aware of it in case you use private/company account to that applications.

VMWARE

This document shows you how to configure Virtual Machine on VMWARE to be able to run Docker-Android.

Cloud

This document contains information about deploying Docker-Android on cloud services.

Genymotion

Genymotion

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

Troubleshooting

All logs inside container are stored under folder /var/log/supervisor. you can print out log file by using docker exec. Example:

docker exec -it android-container tail -f /var/log/supervisor/docker-android.stdout.log

Special Thanks

LICENSE

See License