docker-android/README.md
2017-04-04 18:04:06 +02:00

8.1 KiB

Docker-Android

Build Status codecov

Android in docker solution with noVNC supported

Requirements

Docker is installed in your system.

Purpose

  1. Build android project / application and run unit test inside docker-container
  2. Run UI Test for mobile website with appium framework
  3. Run UI Test for mobile application with different frameworks (appium, espresso, etc.)

Features

  1. Android emulator with different devices
  2. latest build-tool (version 25.0.2)
  3. noVNC to see what happen inside docker container
  4. Appium server and it is able to connect with selenium grid

List of Docker images

Supported OS Android version API level Image name Image status
Linux 5.0.1 21 butomo1989/docker-android-x86-5.0.1
Linux 5.1.1 22 butomo1989/docker-android-x86-5.1.1
Linux 6.0 23 butomo1989/docker-android-x86-6.0
Linux 7.0 24 butomo1989/docker-android-x86-7.0
Linux 7.1.1 25 butomo1989/docker-android-x86-7.1.1
OSX / Windows 5.0.1 21 butomo1989/docker-android-arm-5.0.1
OSX / Windows 5.1.1 22 butomo1989/docker-android-arm-5.1.1
OSX / Windows 6.0 23 butomo1989/docker-android-arm-6.0
OSX / Windows 7.0 24 butomo1989/docker-android-arm-7.0
OSX / Windows 7.1.1 25 butomo1989/docker-android-arm-7.1.1

Quick Start

  1. Enable Virtualization under System Setup in BIOS. (It is only for Ubuntu OS. If you use different OS, you can skip this step).

  2. Run docker-android

    docker run --privileged -d -p 6080:6080 -p 4723:4723 -e DEVICE="Samsung Galaxy S6" -e APPIUM=False --name appium-container butomo1989/docker-android-x86-5.0.1
    

    Optional arguments

     -v <android_project_or_apk>:/root	: You need to share volume or apk file if for example you want to build the android project inside docker container or you want to run UI test by using appium.
     -e APPIUM=True: If you want to use appium as UI test framework to test mobile website or android application
    
  3. Verify the ip address of docker-machine.

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

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

  4. Open http://docker-machine-ip-address:6080/vnc.html from web browser.

Connect to Selenium Grid

This feature can be used only if you set APPIUM=True in environment variable.

Arguments

-e CONNECT_TO_GRID=True	: to connect appium server to your selenium grid.
-e APPIUM_HOST="<host_ip_address>": where / on which instance appium server is running. Default value: 127.0.0.1
-e APPIUM_PORT=<port_number>: which port appium server is running. Default port: 4723
-e SELENIUM_HOST="<host_ip_address>": where / on which instance selenium grid is running. Default value: 172.17.0.1
-e SELENIUM_PORT=<port_number>: which port selenium grid is running. default port: 4444

List of Devices

Type Device Name
Phone Samsung Galaxy S6
Phone Nexus 4
Phone Nexus 5
Phone Nexus 5x
Phone Nexus 6
Phone Nexus 6P
Phone Nexus One
Phone Nexus S
Tablet Pixel C
Tablet Nexus 7
Tablet Nexus 9
Tablet Nexus 10

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 appium-container tail -f /var/log/supervisor/docker-appium.stdout.log