A barebones android device farm for controlling android devices via a web browser.
- A Centos 7 / Fedora 28 Workstation or Ubuntu 18.04 Deskop.
- Install
kernel-modules-extra
viasudo dnf install kernel-modules-extra -y
. hats
user with sudo (root without password) access.
sudo useradd -m hats
sudo usermod -aG wheel hats
echo 'hats ALL=(ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers
- Set up hats-linux for Centos 7 / Fedora or Ubuntu.
- Ensure environment variables to
linuxbrew
,npm
(for appium) andandroid-sdk
are properly configured in/home/hats/.bashrc
.
- 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.
- 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
andvhclientx86_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.
-
Install
xpra
andwebsokify
by usingsudo dnf install xpra python2-websockify -y
(Fedora) orsudo apt install xpra python-websockify -y
(Ubuntu). -
Additionally, for Ubuntu, apply the following fixes:
echo "allowed_users=anybody" | sudo tee --append /etc/X11/Xwrapper.config wget https://raw.githubusercontent.com/younglim/hats-linux/master/binaries/usr-share-xpra-www.zip sudo unzip usr-share-xpra-www.zip -d /usr/share/xpra/
-
For Fedora, install
scrcpy
via linuxbrew by usingbrew install scrcpy
. -
For Ubuntu,
wget https://raw.githubusercontent.com/younglim/hats-linux/master/binaries/scrcpy.zip sudo unzip scrcpy.zip -d /usr/local/share echo "export PATH=$PATH:/usr/local/share/scrcpy" >> ~/.bashrc source ~/.bashrc
- Copy service script
sudo cp device-farm.service /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
- 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
.