• Stars
    star
    585
  • Rank 76,419 (Top 2 %)
  • Language
    Shell
  • License
    Other
  • Created about 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Appium Server setup to automate android testing on real devices

Build and Push Docker Pulls

Appium Docker for Android

Why is this approach needed at first place?

  • Helps in quick & easier setup of automation environment for Appium + Android
  • Without this approach, you'll need to do each of the automation setup steps manually; which can be slow and error prone

Images Included:

  • appium/appium - Docker Image to run appium tests on real Android devices.
  • To execute in Android emulator's please visit docker-android

How to Build:

$ docker build -t "appium/appium:local" -f Appium/Dockerfile Appium

Quick Start

  1. Connect Android device to the machine via USB

  2. Run Appium-Docker-Android

    $ docker run --privileged -d -p 4723:4723  -v /dev/bus/usb:/dev/bus/usb --name appium-container appium/appium
    

    OR you can get the id of the device via this command ls -l /dev/serial/by-id and pass the device-id to container to have more security

    docker run --privileged -d -p 4723:4723 --device=/dev/<your-device-id> --name appium-container appium/appium
    
  3. Run following command to verify adb devices can detect the connected android device.

    $ docker exec -it appium-container adb devices
    
  4. Run UI Test with following test configuration

    Push the apk file into the container
    $ docker cp /home/myuser/localfolder/app-debug.apk appium-container:/home/androidusr/sample.apk
    
    Desired Capabilities:
    
    private void androidSetup() throws MalformedURLException {
            caps.setCapability("deviceName", "Android");
            caps.setCapability("app", "/home/androidusr/sample.apk");
            //Get the IP Address of boot2docker
            //docker inspect $(docker ps -q) | grep IPA
            driver = new AndroidDriver<MobileElement>(new URL("http://192.168.99.100:32769/wd/hub"), caps);
    }
    

Additional configuration

Share Android identification key

Each time, you will (re)create container, connected to container devices will ask for authorization after first connection. To prevent that, you can share one identity through all created containers. To do that, you should:

  • Connect all devices to docker physical machine
  • Run adb devices
  • Authorize all devices (do not forget to check Always allow this computer)

Always allow this computer screenshot

  • run your containers with parameter -v ~/.android:/home/androidusr/.android

For example:

$ docker run --privileged -d -p 4723:4723 -v ~/.android:/home/androidusr/.android -v /dev/bus/usb:/dev/bus/usb --name appium-container appium/appium

Connect Each Device to a Separate Container

In certain use cases you may want to have a single Appium-Docker-Android container running for each device. To achieve this you must run adb kill-server and then provide the --device option to docker run:

$ docker run -d -p 4723:4723 --device /dev/bus/usb/XXX/YYY:/dev/bus/usb/XXX/YYY -v ~/.android:/root/.android --name device1 appium/appium
$ docker run -d -p 4724:4723 --device /dev/bus/usb/XXX/ZZZ:/dev/bus/usb/XXX/ZZZ -v ~/.android:/root/.android --name device2 appium/appium

Connect to Android devices by Air

Appium-Docker-Android can be connected with Android devices by Air.

To do that you need to configure android device, according to official manual

Then run docker container with following parameters:

  • REMOTE_ADB=true
  • ANDROID_DEVICES=<android_device_host>:<android_device_port> [,<android_device_host>:<android_device_port>]
  • REMOTE_ADB_POLLING_SEC=60 (default: 5, interval between polling the list of connected devices in order to connect to lost remote devices)
$ docker run -d -p 4723:4723 -e REMOTE_ADB=true -e ANDROID_DEVICES=192.168.0.5:5555,192.168.0.6:5555 -e REMOTE_ADB_POLLING_SEC=60

Additional Appium parameter

APPIUM_ADDITIONAL_PARAMS="", e.g. --relaxed-security --allow-insecure chromedriver_autodownload --allow-insecure adb_shell

Connect to Selenium Grid

Appium-Docker-Android can be connected with selenium grid by passing following parameters:

  • CONNECT_TO_GRID=true
  • APPIUM_HOST=<ip_address_of_appium_server>
  • APPIUM_PORT=<port_of_appium_server>
  • SELENIUM_HOST=<ip_address_of_selenium_hub>
  • SELENIUM_PORT=<port_of_selenium_hub>
$ docker run --privileged -d -p 4723:4723 -e CONNECT_TO_GRID=true -e APPIUM_HOST="127.0.0.1" -e APPIUM_PORT=4723 -e SELENIUM_HOST="172.17.0.1" -e SELENIUM_PORT=4444 -v /dev/bus/usb:/dev/bus/usb --name appium-container appium/appium

Custom Node Config

The image generates the node config file, if you would like to provide your own config pass the following parameters:

  • CONNECT_TO_GRID=true
  • CUSTOM_NODE_CONFIG=true
  • -v <path_to_config>:/root/nodeconfig.json

Docker compose

There is an example of compose file to simulate the connection between selenium hub and appium server with connected device(s) in docker solution.

$ docker-compose up -d

More Repositories

1

appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
JavaScript
18,666
star
2

appium-desktop

Appium Server in Desktop GUIs for Mac, Windows, and Linux
JavaScript
4,709
star
3

python-client

Python language bindings for Appium
Python
1,669
star
4

java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Java
1,203
star
5

appium-inspector

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server
JavaScript
1,125
star
6

appium-xcuitest-driver

Appium iOS driver, backed by Apple XCTest
JavaScript
736
star
7

appium-uiautomator2-driver

Appium driver for Android UIAutomator2
JavaScript
558
star
8

appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
TypeScript
451
star
9

dotnet-client

Extension to the official Selenium dotnet webdriver
C#
381
star
10

appium-uiautomator2-server

Appium UiAutomator/UiObject2-based server for Android UI automation. This module is used by appium-uiautomator2-driver component
Java
326
star
11

appium-adb

Wrapper around adb used by appium + helper libs
JavaScript
273
star
12

appium-android-driver

Common methods collection used by Android drivers
JavaScript
249
star
13

android-apidemos

A fork of Google's Android ApiDemos application, used for testing Appium
Java
235
star
14

ruby_lib

πŸ’Ž Ruby library for Appium
Ruby
216
star
15

appium-for-mac

[deprecated] Application for automating a mac app with JSON wire protocol
Objective-C
193
star
16

appium-espresso-driver

Espresso integration for Appium
Kotlin
189
star
17

appium-doctor

[Deprecated] Please use https://github.com/appium/appium/tree/master/packages/doctor
JavaScript
128
star
18

appium-ios-device

Tools for interacting with iOS devices
JavaScript
126
star
19

appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Objective-C
124
star
20

io.appium.settings

App for dealing with Android settings
Java
121
star
21

appium-ios-simulator

Module for interacting with iOS simulators
JavaScript
97
star
22

appium-base-driver

Base class for an Appium driver
JavaScript
82
star
23

appium-idb

idb integration for Appium
JavaScript
75
star
24

ios-uicatalog

Apple UICatalog App
Objective-C
73
star
25

appium-chromedriver

Node.js wrapper around Chromedriver
JavaScript
66
star
26

mitmproxy-java

A bridge between Python's mitmproxy and Java programs. Built on top of mitmproxy-node
Java
64
star
27

node-simctl

Node wrapper around Apple's simctl binary
JavaScript
63
star
28

ruby_console

🎁 Appium Ruby Console
Ruby
45
star
29

appium-remote-debugger

Module for dealing with Remote Debugger protocol
JavaScript
44
star
30

appium_capybara

Gem enabling appium support in capybara
Ruby
40
star
31

appium-mac-driver

[deprecated] Mac application driver for Appium
JavaScript
36
star
32

ios-test-app

iOS app for testing
Objective-C
35
star
33

ruby_lib_core

Core library for the Ruby client
Ruby
34
star
34

selenium-swift

selenium bindings for the swift programming language
Swift
33
star
35

node-teen_process

A slightly more grown-up version of Node's child_process
JavaScript
27
star
36

node-adb-client

A direct-to-device ADB client implementation in Node
JavaScript
27
star
37

appium-safari-driver

Safari browser support for Appium
JavaScript
24
star
38

appium.io

[deprecated] The public front-end for Appium
CSS
21
star
39

appium-support

Support libs used across appium packages.
JavaScript
17
star
40

appium-chromium-driver

An Appium driver for the Chrome browser
JavaScript
17
star
41

appium-xcode

Xcode related utilities. Get version number and path to executable.
JavaScript
16
star
42

appium-geckodriver

Support for Geckodriver (Firefox driver) within Appium
JavaScript
15
star
43

sample-apps

Sample app manager, for testing
JavaScript
14
star
44

VodQAReactNative

Sample react native app demoing components and gestures
JavaScript
10
star
45

screenshooter

Screenshot application for Android
Java
10
star
46

appium-fake-driver

A fake Appium driver used for testing and demonstration
JavaScript
8
star
47

droiddriver_examples

Java
6
star
48

DynamicApp

Titanium app generating random code + command injector.
JavaScript
6
star
49

appium-gulp-plugins

Custom plugins used across appium modules
JavaScript
5
star
50

dump2json

Converts UIAutomator XML dump to JSON for Appium.
Java
5
star
51

io.appium.gappium.sampleapp

Appium Sample App for Cordova Test Automation (Gappium)
JavaScript
5
star
52

appium-test-support

A collection of test utility lib used across Appium packages
JavaScript
4
star
53

appium-build-store

Temporary store for Appium builds, for sub-package CI systems
4
star
54

gps-demo-app

Android GPS demo from http://www.impressive-artworx.de/tutorials/android/gps_tutorial_1.zip
Java
4
star
55

appium-event-parser

Node CLI script to help parse event timing output from Appium scripts
JavaScript
4
star
56

appium-gui-libs

Code shared between various Appium GUI projects (Appium Desktop Server, Appium Inspector)
JavaScript
4
star
57

perl-client

Perl
3
star
58

workshop

To be used when people do Appium workshops
JavaScript
3
star
59

clean_apk

APK used to clean up between tests for Appium.
Java
3
star
60

eslint-config-appium

Shared configuration for ESLint
JavaScript
3
star
61

python-client-sphinx

Docs repo for Appium Python Client
3
star
62

worms

Issue tracker for Apple bugs affecting Appium
2
star
63

appium-ios

iOS-specific packages for Appium
JavaScript
2
star
64

ios-webview-app

Webview app for testing appium
Objective-C
2
star
65

blog

A GH powered Appium blog
1
star
66

dmg-template

dmg template for building appium-dot-app
Objective-C
1
star
67

appium.github.com

Appium.io
JavaScript
1
star
68

ios

Appium mono repo containing iOS specific packages.
1
star
69

appium_thor

Appium Thor helpers for appium's gems
Ruby
1
star
70

appiumlogs

Logs from the #appium IRC channel on freenode.net
Shell
1
star
71

packweb

Tools for maintaining projects with large numbers of packages
JavaScript
1
star
72

appium-package-master

A set of tools to create and manage appium packages.
JavaScript
1
star
73

jobs

Appium job board
1
star
74

test_runner

Ruby test runner for Appium
Ruby
1
star
75

appium-benchmarks

A suite of exercises designed to evaluate the performance of an Appium server or service
TypeScript
1
star