6.6Best Practices for Cloud Device Farms
Parallelize aggressively -- Cloud farms charge per device-minute. Running 10 devices in parallel for 5 minutes costs the same as 1 device for 50 minutes but finishes 10x faster.
Use smart test distribution -- Not all tests need to run on all devices. Run full regression on Tier 1 devices, critical paths on Tier 2, and smoke tests on Tier 3.
Cache app uploads -- Upload your app binary once per build, then reference it across all device runs.
Enable video recording for failures only -- Video recording adds overhead. Enable it for debugging failed runs, not for every successful test.
Set idle timeouts -- Cloud devices are billed while idle. Set aggressive timeouts (3-5 minutes) to prevent zombie sessions.
Tag builds for traceability -- Include git SHA, branch name, and PR number in build tags so you can correlate test results with code changes.
build_name = f"{os.environ.get('GITHUB_SHA', 'local')[:8]}-" \
f"{os.environ.get('GITHUB_REF_NAME', 'dev')}"
Cloud device farms are the only practical way to achieve broad device coverage for mobile applications. The upfront investment in configuration pays for itself in testing confidence and bug prevention.