Git Product home page Git Product logo

mcloud-android-old's Introduction

Zebrunner Device Farm (Android slave)

Contents

Software prerequisites

ansible-galaxy collection install community.general

Initial setup

  • Update hosts file to manage several hosts by Ansible otherwise localhost only will be configured.
  • Update roles/devices/vars/main.yml file:
    • Set stf_provider_host to the private ip of your android slave (it should be accessible from MCloud master host)
    • Set stf_private_host and stf_public_host using the actual value from MCloud master setup. Physically mcloud-andriod slave can be located on the same Linux server where STF is deployed
    • Set selenium_hub_host and selenium_hub_port values. By default we have values for the schema when MCloud is deployed on the same server
    • Declare/whitelist all Android devices using structure below
stf_provider_host: 192.168.88.10
stf_private_host: 192.168.88.10
stf_public_host: stf.mydomain.com
selenium_hub_host: mcloud-grid
selenium_hub_port: 4444
devices:
  - id: 085922ed01829ce3
    name: Nexus_5
    adb_port: 5038
    min_port: 7401
    max_port: 7410
    proxy_port: 9000
  - id: 0186a5f28f9837e9
    name: Nexus_4
    adb_port: 5039
    min_port: 7411
    max_port: 7420
    proxy_port: 9001
  • Note: Make sure to provide valid device udid values
  • Name value will be used for registration this device in STF (it is recommended to avoid special symbols and spaces)
  • Provide unique adb port values for each device as they will be shared to the master Linux server
  • Provide unique range of 10 ports for each Android device. Those ports should be accessible from client's browser sessions otherwise gray screen is displayed or "adb connect" doesn't work.
  • Provide unique number of proxy_port per each device (they can be used in integration with Carina traffic sniffering fucntionality: http://qaprosoft.github.io/carina/proxy/)
  • Run ansible-playbook script to download required components and setup udev rules:
ansible-playbook -vvv -i hosts devices.yml

To provide extra arguments including sudo permissions you can use

ansible-playbook -vvv -i hosts --user=USERNAME --extra-vars "ansible_sudo_pass=PSWD ssl_crt=/home/ubuntu/ssl.crt ssl_key=/home/ubuntu/ssl.key" devices.yml
  • Container creation/removal script deployed to /usr/local/bin/device2docker
  • Udev rules with whitelisted devices are in /etc/udev/rules.d/51-android.rules
  • Whitelisted devices custom properties are in /usr/local/bin/devices.txt

Usage

  • Enable developer option for each device (TODO: exact and recommended configuration steps should be provided for Android device)
  • Connect Android device physically into USB direct port or through the hub
  • For the 1st connection trust device picking "always trust..." on device
  • Open in your browser http://<PUBLIC_IP>, authenticate yourself based on preconfigured auth system.
  • Connected device should appear automatically in iSTF with ability to use it remotely
  • Dedicated fully isolated android container is started per each device
docker ps -a | grep device
  • Disconnect device from the server. In 30-60 seconds it should change state in iSTF to disconnected as well. Appropriate container is removed automatically
  • Note: adb server should not be started on the master host during devices connect/disconnect! Otherwise device will be unavailable for isolated adb inside container

License

Code - Apache Software License v2.0

Documentation and Site - Creative Commons Attribution 4.0 International License

mcloud-android-old's People

Contributors

vdelendik avatar hursevich avatar aanisimov avatar

Watchers

James Cloos avatar  avatar

Forkers

apakhomov

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.