{"slug": "keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and", "title": "Keeping track of 100+ Android test devices: 8 practices for naming, tagging and access", "summary": "A developer documented eight practices for managing fleets of 100+ Android test devices, recommending role-based naming, keying records by stable identifiers such as USB serials and AVD names, shared tag vocabularies, single owning teams, and scheduled inventory generation from adb output rather than hand-kept spreadsheets. The writeup, based on reading Android's adb, emulator and avdmanager documentation plus AWS Device Farm, DeviceFarmer STF and Multilogin materials, found that only two of six common device identifiers stay stable on their own, and that a Python 3.12 script was tested against a stub adb replaying documented sample output rather than a real fleet.", "body_md": "To manage 100+ Android test devices, give each one a role-based name and key its record by the one identifier that doesn't drift. Tag it from a short shared vocabulary, assign one owning team, and keep its state in a note. Then build the inventory from `adb` output on a schedule instead of a hand-kept spreadsheet. This works the same for physical phones, emulators and cloud Android phones.\n\n**Updated November 2026**\n\n*This article was written by AI from a human brief. Every fact links to or names its source, and the script below was run against the sample output in Android's adb documentation.*\n\nThis is a documentation comparison, not a device-lab test. On 24 November 2026 I read Android's [adb documentation](https://developer.android.com/tools/adb) and its emulator and `avdmanager` pages. I also read AWS's private devices guide, the DeviceFarmer STF README and Multilogin's product and help pages.\n\nThree dashboards appear as examples: DeviceFarmer STF, AWS Device Farm private devices, and Multilogin, a cloud Android phone platform for multi-account management. I judged each on device types covered, tagging, bulk actions and export, and access control.\n\nI also read recent reviews and issues on G2, Capterra and GitHub. The script was tested with Python 3.12 against a stub `adb` replaying the documented `adb devices -l` sample, not a real fleet.\n\nThe short version: name by role, key by a stable ID, tag consistently, assign owners, track state, control access, and generate the inventory.\n\n`emulator-5554`.` key:value` tags such as `api:34` or `purpose:smoke`. Free text forks fast: `smoke`, `Smoke` and `smoke-test` become three tags for one idea.\nEncode only what never changes, in a fixed order and in lowercase. My format is `<kind>-<form>-<home>-<nnn>`:\n\n`kind`: `phy` for physical, `emu` for emulator, `cld` for cloud Android phone`form`: `ph` phone, `tb` tablet, `fd` foldable`home`: the shelf, CI host or cloud region that holds it` nnn`: a three-digit number, retired with the device\n\n```\nphy-tb-shelf2-041    tablet on shelf 2, USB to lab host 1\nemu-ph-ci03-012      phone AVD on CI host 3\ncld-ph-eu1-118       cloud Android phone in an EU region\n```\n\nWhat's left out matters more. API level changes with every OS update, and ownership changes with every reorg. Both belong in tags, where a change is one edit rather than a rename everywhere.\n\nFor emulators, make the AVD name and the inventory name the same string. Android's `avdmanager` sets the name with `create avd -n` and renames in place with `move avd -n <old> -r <new>`.\n\nOnly two of the six identifiers I checked stay put on their own: a USB phone's hardware serial and an emulator's AVD name. The other four can change or vanish without anyone editing your records.\n\nI traced each one through official documentation on 24 November 2026:\n\n| Identifier | Example | Set by | What changes it | \n|---|---|---|---|\n| USB serial | `0a388e93` | manufacturer | nothing, but it isn't always unique | \n| Emulator serial | `emulator-5554` | adb, from the console port | the port the emulator started on | \n| Network serial | `0.0.0.0:6520` | adb, from the address | any change of IP or port | \n| AVD name | `Pixel_8_API_35` | you | only a deliberate rename | \n| Device Farm instance ARN | one per device | AWS | hardware replacement | \n| Device Farm instance label | your text | you | lost on hardware replacement | \n\nThe emulator serial, network serial and instance ARN all change without anyone touching the record. Per AWS's guide, a replacement instance also loses the old device's labels. Even the USB serial has a catch: STF's README describes a budget Android 4.4 device whose serial is `0123456789ABCDEF`.\n\nTwo habits follow. Key emulators by AVD name, which `adb -s <serial> emu avd name` returns per the emulator console docs. And if a provider can swap hardware, put each tag on several devices so a pool survives a replacement. That lesson comes from Device Farm's docs, but it fits any hosted device service.\n\nThey differ most on who owns the hardware and what happens when it's replaced. Here are three on the same four points.\n\n|  | DeviceFarmer STF | AWS Device Farm (private) | Multilogin | \n|---|---|---|---|\n| Devices | physical, on your hosts | physical, hosted by AWS | cloud Android phones | \n| Organizing | attribute search, groups with schedules | instance labels, device pools | colour tags, notes, custom columns | \n| Bulk and automation | bulk removal by filter, REST API | pools via console, CLI or API | bulk actions, data export, API, ADB | \n| Access | groups of users and devices | IAM identity-based policies | team seats and permissions | \n\nMy take: if the hardware sits on your own shelves, STF is built for that. If you want AWS to own the devices and run test jobs, Device Farm fits. If your fleet mixes app testing with account-based work on cloud Android phones, Multilogin fits. None sees past its own boundary, hence the registry below.\n\nRun one script per adb host on a schedule, merge its output with a registry kept in git, and alert on anything unregistered or missing.\n\n`adb_inventory.py` v1.0.0 uses three documented commands: `adb devices -l`, `adb -s <serial> shell getprop` and `adb -s <serial> emu avd name`. Property names such as `ro.build.version.sdk` come from AOSP build files. The registry maps a key to a name, owner and tags, with `avd:<name>` keys for emulators:\n\n```\n{\n  \"0a388e93\": {\"name\": \"phy-tb-shelf2-041\", \"owner\": \"qa-payments\", \"tags\": [\"api:23\", \"form:tablet\"]},\n  \"avd:Pixel_8_API_35\": {\"name\": \"emu-ph-ci03-012\", \"owner\": \"platform\", \"tags\": [\"api:35\", \"purpose:smoke\"]}\n}\n```\n\nThe script:\n\n``` bash\n#!/usr/bin/env python3\n\"\"\"adb_inventory.py: list adb-visible Android devices and check them against a registry.\n\nUses only adb commands from developer.android.com/tools/adb and the\nemulator console docs. Python 3.8+, standard library only.\n\"\"\"\nimport csv\nimport json\nimport os\nimport socket\nimport subprocess\nimport sys\nfrom datetime import datetime, timezone\n\n__version__ = \"1.0.0\"\nADB = os.environ.get(\"ADB_PATH\", \"adb\")\nPROPS = {\n    \"manufacturer\": \"ro.product.manufacturer\",\n    \"model\": \"ro.product.model\",\n    \"android\": \"ro.build.version.release\",\n    \"api\": \"ro.build.version.sdk\",\n}\nFIELDS = [\"checked_at\", \"host\", \"status\", \"name\", \"owner\", \"tags\", \"key\",\n          \"serial\", \"kind\", \"state\", \"avd\"] + list(PROPS)\n\ndef adb(*args, timeout=15):\n    try:\n        res = subprocess.run([ADB, *args], capture_output=True,\n                             text=True, timeout=timeout)\n        return res.stdout.strip()\n    except (OSError, subprocess.TimeoutExpired):\n        return \"\"\n\ndef connected():\n    \"\"\"Parse `adb devices -l` into dicts.\"\"\"\n    listing = adb(\"devices\", \"-l\")\n    if \"List of devices\" not in listing:\n        sys.exit(\"adb returned no device list: check ADB_PATH and the adb server\")\n    for line in listing.splitlines():\n        if not line.strip() or line.startswith((\"List of devices\", \"*\")):\n            continue\n        parts = line.split()\n        state = parts[1] if len(parts) > 1 else \"unknown\"\n        yield {\"serial\": parts[0], \"state\": state}\n\ndef kind_of(serial):\n    if serial.startswith(\"emulator-\"):\n        return \"emulator\"\n    return \"network\" if \":\" in serial else \"usb\"\n\ndef describe(dev):\n    serial = dev[\"serial\"]\n    row = {\"serial\": serial, \"state\": dev[\"state\"], \"kind\": kind_of(serial),\n           \"avd\": \"\", **{k: \"\" for k in PROPS}}\n    if dev[\"state\"] == \"device\":\n        for key, prop in PROPS.items():\n            row[key] = adb(\"-s\", serial, \"shell\", \"getprop\", prop)\n        if row[\"kind\"] == \"emulator\":\n            lines = adb(\"-s\", serial, \"emu\", \"avd\", \"name\").splitlines()\n            row[\"avd\"] = lines[0].strip() if lines else \"\"\n    # Emulator serials follow the console port, so key emulators by AVD name.\n    row[\"key\"] = \"avd:\" + row[\"avd\"] if row[\"avd\"] else serial\n    return row\n\ndef main(registry_path):\n    with open(registry_path, encoding=\"utf-8\") as fh:\n        registry = json.load(fh)\n    now = datetime.now(timezone.utc).isoformat(timespec=\"seconds\")\n    base = {\"checked_at\": now, \"host\": socket.gethostname()}\n    devices = list(connected())\n    out = csv.DictWriter(sys.stdout, fieldnames=FIELDS)\n    out.writeheader()\n    seen = set()\n    for dev in devices:\n        row = {**base, **describe(dev)}\n        entry = registry.get(row[\"key\"])\n        seen.add(row[\"key\"])\n        row[\"status\"] = \"registered\" if entry else \"UNREGISTERED\"\n        entry = entry or {}\n        row[\"name\"] = entry.get(\"name\", \"\")\n        row[\"owner\"] = entry.get(\"owner\", \"\")\n        row[\"tags\"] = \" \".join(entry.get(\"tags\", []))\n        out.writerow(row)\n    for key, entry in registry.items():\n        if key not in seen:\n            out.writerow({**base, \"status\": \"MISSING\", \"key\": key,\n                          \"name\": entry.get(\"name\", \"\"),\n                          \"owner\": entry.get(\"owner\", \"\"),\n                          \"tags\": \" \".join(entry.get(\"tags\", []))})\n\nif __name__ == \"__main__\":\n    if len(sys.argv) != 2 or sys.argv[1] in (\"-h\", \"--help\"):\n        sys.exit(f\"adb_inventory {__version__}\\nusage: adb_inventory.py registry.json\")\n    main(sys.argv[1])\n```\n\nRun it from cron on each host, for example every weekday at 07:00:\n\n```\n0 7 * * 1-5 cd /opt/inventory && python3 adb_inventory.py registry.json > \"out/$(hostname)-$(date +\\%F).csv\"\n```\n\nAgainst the stub, columns trimmed, the output looked like this:\n\n```\nstatus,name,owner,key,serial,kind,state\nUNREGISTERED,,,avd:Tablet_API_35,emulator-5556,emulator,device\nregistered,emu-ph-ci03-012,platform,avd:Pixel_8_API_35,emulator-5554,emulator,device\nregistered,phy-tb-shelf2-041,qa-payments,0a388e93,0a388e93,usb,device\nUNREGISTERED,,,0.0.0.0:6520,0.0.0.0:6520,network,offline\nMISSING,phy-ph-shelf1-007,qa-growth,R58M00000000,,,\n```\n\nDesign choices worth knowing before you adopt it:\n\n`host` column matters.\nGive each device a role-based name, a stable key, shared tags and one owner. Then generate the inventory from adb output on a schedule and diff it against a registry in git.\n\nYes. Use the same format with a different kind code, and make the AVD name match the inventory name. Don't key emulators by `emulator-5554`, because that serial follows the console port.\n\nRemove them from the dashboard or device group first. Then revoke adb debugging authorizations on the device itself. Android's docs note that this unpairs every workstation, so CI hosts need approving again.\n\nMultilogin documents full ADB access for its cloud phones, so the same adb commands apply once a phone is connected. Its desktop app adds colour tags, notes, bulk actions and data export. Cloud phones can't receive SMS or calls, so tests that need a one-time code need a separate number.", "url": "https://wpnews.pro/news/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and", "canonical_source": "https://dev.to/aleena_khan_b2f4d6c5df6c4/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and-access-584p", "published_at": "2026-11-24 19:37:58+00:00", "updated_at": "2026-11-24 19:45:53.251485+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Android", "adb", "AWS Device Farm", "DeviceFarmer STF", "Multilogin", "avdmanager", "Python"], "also_reported_by": [], "takeaway": "Key emulator records by AVD name (returned by `adb -s <serial> emu avd name`) and physical devices by USB serial, since emulator serials, network serials and Device Farm instance ARNs change without anyone editing the record.", "recommendation": {"advice": "Generate your device inventory from scheduled `adb devices -l` output and key each record by a stable identifier like the AVD name or USB serial, not the emulator port or network address.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and", "markdown": "https://wpnews.pro/news/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and.md", "text": "https://wpnews.pro/news/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and.txt", "jsonld": "https://wpnews.pro/news/keeping-track-of-100-android-test-devices-8-practices-for-naming-tagging-and.jsonld"}}