A barebones android device farm for controlling android devices via the web browser.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
RestartVirtualHere.cmd
TaskSchedulerVirtualHereServerConfig.xml
crontab
device-farm-screenshot.png
device-farm.service
installVhClientServer.sh
restartLiveView.sh
restartLiveViewToLog.sh
restartVhClient.sh
runVhui.sh
terminateLiveViewSessions.sh

README.md

barebones-device-farm

A barebones android device farm for controlling android devices via a web browser.

Screenshot

Screenshot of multiple devices displayed on web brpwser

Setting up

Pre-requisites

  • A Fedora 28 Workstation.
  • Install kernel-modules-extra via sudo dnf install kernel-modules-extra -y .
  • hats user with sudo (root without password) access.
  • Set up hats-linux.
  • Ensure environment variables to linuxbrew, npm (for appium) and android-sdk are properly configured in /home/hats/.bashrc.

Set-up USB Server

  • Go to VirtualHere Server and download VirtualHere Server.
  • You can run VirtualHere Server on a separate machine. This machine will act as the USB Server
  • A VirtualHere license is required to connect more than 1 android device.
  • Ensure VirtualHere USB Server process / service is running.
  • Refer to VirtualHere Server documentation for more information on setting up USB Server.

Set-up USB Client

  • Clone or download this repo and copy it's contents to /opt/scripts.
  • On the Fedora workstation, install VirtualHere Client by downloading their linux release. Note: Commercial software.
  • Copy vhuit64 and vhclientx86_64 to /opt/scripts .
  • Ensure the USB Client can access the USB Server running VirtualHere Server. TCP port 7575 or 17575 must be open.
  • Within a Desktop Environment, run /opt/scripts/runVhui.sh . Choose the USB Server and device(s) you want to attach to the USB Client.

Set-up barebones-device-farm

  • Install xpra and websokify by using sudo dnf install xpra python2-websockify -y.
  • Install scrcpy via linuxbrew by using brew install scrcpy.
  • Modify /opt/scripts/restartLiveView.sh with android device serial number where MYANDROIDSERIALNUMBER is your android serial number.
  • Copy service script /opt/scripts/device-farm.service to /etc/systemd/system.
  • Run sudo systemctl daemon-reload.
  • Enable the service sudo systemctl enable device-farm.service.
  • Allow service to start on boot by running the following as root if [ -f /etc/systemd/system/*.wants/device-farm.service ]; then echo "On"; else echo "Off"; fi

Run

  • Start the service by using sudo systemctl start device-farm.service.
  • Check service is running sudo systemctl status device-farm.service.
  • Browse and control your android device http://localhost:14500.

Other Usage

  • Set up your own CI tool such as GoCD or Bamboo and run appium / robot framework tests.
  • Check the xpra.org website for more information on usage scenarios and configuring display client.