← all articles

What is an Android device farm and how does it work?

An Android device farm is a group of Android devices, real phones or emulators, wired up so you can run apps and tests on them remotely and in parallel. Instead of one phone on your desk with a cable, you have a shelf, a rack or a cloud account full of them, and software decides which device a given job or person gets.

If you test apps or run anything that must behave the same across many Android versions and screen sizes, one phone eventually stops being enough. I run phones in Singapore for a living, so this is the operator’s view: what the pieces are, where it breaks, and what is worth building versus renting.

What it is

A device farm is three things stacked together:

  • devices: the phones or emulators that actually run Android
  • hosts: the computers the devices plug into, usually small Linux boxes or mini PCs
  • a control layer: software that lists devices, hands them out, and lets a script or a human drive them

A drawer of old phones on a powered USB hub, with a script that runs the same test on each, is a device farm. A commercial cloud with thousands of devices is the same idea with more engineering around it.

The term gets used in two slightly different ways, so it helps to separate them:

  • test farms: built for QA. Devices are reset between runs, jobs are queued, results are collected. Appium and CI systems sit on top.
  • operation farms: built to keep phones running long-lived tasks, such as an app you own that needs a real mobile connection around the clock. Devices are persistent and usually not wiped.

The plumbing is the same; the difference is whether devices are disposable.

How it works

The host and the usb layer

Every real phone in a farm connects by USB to a host. The host runs the Android Debug Bridge, adb, which is the standard tool from Google’s platform-tools package. The official adb documentation describes the three parts: a client (the adb command), a daemon (adbd) running on each device, and a server on the host that manages communication between them and listens on local TCP port 5037 by default.

The phone needs USB debugging switched on in developer options, and you approve the host’s RSA key the first time. After that, adb devices -l lists every connected device with its serial number, and adb -s <serial> shell targets one specific phone. Using -s on every command is the single most important habit once you have more than one device attached, because without it adb refuses to guess.

The physical layer is where most farms actually fail. Cheap unpowered USB hubs cannot charge and carry data for ten phones. Phones drop off the bus, reconnect with the same serial, or vanish until someone reseats a cable. A farm that works needs powered hubs, decent cables, and a way to notice that a device went offline.

The adb server and remote access

By default the adb server only talks to the machine it runs on. To use devices on a different host, adb has the -H (host) and -P (port) flags, and an ADB_SERVER_SOCKET environment variable, both covered in the adb docs. So adb -H 192.168.1.20 -P 5037 devices asks a remote server what it can see.

I would be careful here. The adb server has no authentication of its own, so exposing it on a network means anyone who reaches that port can control the phones. Keep it on a private network or inside a tunnel like WireGuard, never on the open internet.

Android 11 and later can also do wireless debugging with adb pair and adb connect, so a phone can join without a cable. It is handy for a few devices on a lab bench. For a large farm I still prefer USB, because it charges the phone and does not depend on wifi staying healthy.

The control layer

Once devices are visible to adb, something has to coordinate them. There are a few common approaches:

  • scripts and a queue: a simple scheduler assigns jobs to free serial numbers. This is enough for a small private lab.
  • Appium: the Appium documentation describes a server that exposes a WebDriver-style API. On Android, Appium 2 uses the UiAutomator2 driver, installed with appium driver install uiautomator2. You point test code at a device by its udid capability, and Appium talks to adb underneath. If you are weighing it against lighter tools, I compared them in Maestro vs Appium on Android.
  • STF-style remote control: Smartphone Test Farm, now maintained as DeviceFarmer/stf on GitHub, gives you a browser interface to a pool of devices. You see the phone screen, click and type, reserve a device for a while, and release it. Behind it are providers (processes on each host that watch adb) and a central app that tracks who is using what. It is the closest thing to an open source reference design for a device farm.

Most real setups mix these. STF or something like it for humans who want to touch a screen, Appium or scripts for machines that do it at scale.

Scheduling

Scheduling is the part newcomers underestimate. Someone has to answer: which free device matches this job (Android version, screen size, brand), who holds it right now, and what happens if it crashes mid-run? STF handles reservation for humans. For automated jobs, a CI system with device labels or a small custom queue does the same. Without scheduling, two scripts grab the same phone and you get failures that look random.

If you want to run the Appium side in a container, I wrote about running UiAutomator2 device automation inside Docker. The short version is that USB passthrough is the awkward bit, not the automation.

Emulator farms versus real-phone farms

An emulator farm replaces physical phones with virtual ones. The Android Emulator documentation covers how Android Virtual Devices are created and run. Emulators are cheap to scale, easy to reset to a clean state, and perfect for fast checks on many Android versions.

Real phones give you what emulators cannot:

  • real hardware behaviour: thermal throttling, battery, sensors, vendor skins and the odd bugs manufacturers add
  • real cellular networks: an emulator uses your host’s internet connection, not a mobile carrier
  • real-world app behaviour: many apps treat emulators differently from physical devices, which matters when you want to see what users actually get

Most teams I know end up with both. Emulators for the quick wide sweep, real phones for the checks that matter before release.

Why it matters

  • parallel testing: running the same suite on ten devices at once turns a slow overnight run into something you can wait for.
  • device coverage: Android is fragmented across versions, screen sizes and manufacturer skins. A bug that only shows on one vendor’s Android 14 build will not appear on your own phone. A farm lets you keep a representative set around.
  • remote access for a team: with STF-style control, a developer in one city can use a phone sitting in another.
  • real network conditions: carriers differ in how they handle traffic, NAT and IP assignment. I covered this in testing apps on real carrier networks. If your app behaves differently on mobile data, only real SIMs on real devices will show it.

Common misconceptions

Wrong: “a device farm is the same as an emulator.” Emulators are one kind of farm node, and a useful one, but a real-device farm exists specifically because emulators miss hardware, carrier and vendor-specific behaviour.

Wrong: “you need root to run a farm.” Almost all of the setup above works on stock, non-rooted phones through adb and UiAutomator2. Root changes what you can reach and adds risk. I go through the trade-offs in root vs non-root Android automation.

Wrong: “more devices means more reliability.” More devices means more cables, more hubs, more things that can go offline at 3am. Reliability comes from monitoring, power, scheduling and a boring reset routine, not from headcount of phones.

Wrong: “a farm will get around app protections.” It will not, and that is not what it is for. Run automation only against apps and devices you own or are authorised to test. If an app or platform forbids automation in its terms, a farm does not change that, and I do not cover ways around root detection, Play Integrity or anti-tamper.

Where to go from here

If you are deciding whether to build or rent, the honest breakdown goes like this. Building gives you control and low per-device cost over time, but you pay in setup hours, hardware failures and your own maintenance. Renting costs more per device-month but removes the cable and hub problems.

One option I run myself: cloudf.one rents real Android phones in Singapore on dedicated hardware, each with a persistent Singapore mobile IP, controlled from the browser. It is Singapore only, so it only helps if you need phones on Singapore carriers. One thing to be clear about: there is no self-service adb. adb and Appium reach a rented phone only through a WireGuard tunnel that we set up on request by email at [email protected]. If you only need to look at an app on a real local phone, the browser control is enough. If you need scripts against it, ask first.

Follow-up reading on this site:

The full list of articles is in the blog index.

Written by Xavier Fok

disclosure: this article may contain affiliate links. if you buy through them we may earn a commission at no extra cost to you. verdicts are independent of payouts. last reviewed by Xavier Fok on 2026-10-19.

free download
The adb and scrcpy command cheat sheet

The commands we reach for on a rack of real phones, on one printable page. Leave your email and we will also tell you when we publish a new guide, a few times a month at most.

from the team behind cloudf.one
Passes on the emulator, fails on a real phone?

cloudf.one rents real Android phones in Singapore that you control from the browser, each on a persistent Singapore mobile IP. Real hardware, a real OEM build and a real carrier network, without buying and racking the phones yourself.

test on a real phone →
read on
More from ADB Handbook

adb commands, scrcpy flags, automation frameworks, and why a test passes on one phone and fails on the next.

browse all articles →