Setting up test devices safely
How to turn a spare phone into a test device without risking anyone's accounts or data, what a test lab may change on it, and how to test on someone's own phone instead.
A test device is a phone kept only for testing. Nobody reads their messages on it, signs in to their bank on it or keeps their photos on it, so automated tests can clear its browser, keep it awake and reset what they need to. A phone someone also uses day to day is a personal phone: tests can still run on it, but its settings and its owner's browser should be left alone.
Deciding which one a phone is comes first. Everything else follows from it.
Test device or personal phone
| Test device | Personal phone | |
|---|---|---|
| Who uses it | only the tests | its owner, and the tests sometimes |
| Accounts on it | test accounts only | its owner's real accounts |
| Its browser | cleared between tests | never touched: tests use a separate one |
| Its settings | may be changed for testing | left exactly as they are |
| While a test runs | kept awake and unlocked | has to be awake and unlocked by its owner |
When in doubt, call it personal. A test lab that treats a personal phone as a test device can wipe someone's browser tabs and sign-ins.
What a test lab may change on a test device
Each of these makes tests more reliable. Each is also a change to the phone, so choose them one by one:
- Keep it awake while it charges. A phone that locks halfway through a test fails it. On Android this is Settings › System › Developer options › Stay awake.
- A longer screen timeout. Thirty minutes is enough for a long test. On an iPhone: Settings › Display & Brightness › Auto-Lock.
- Clear the browser's data between tests. Every test starts from a clean browser, with no cookies or sign-ins left from the last one. Leave it off if you keep anything in that browser you want to keep.
- Close a browser that's stuck. If a test leaves Safari on an iPhone unable to start again, the lab closes it, as a person would by swiping it away.
- Stop charging at 80%. A phone on its charger all day lasts longer this way. On a Pixel with Android 15 or newer: Settings › Battery › Battery health › Charging optimization.
Keep it a test device
- Use test accounts only. Sign in with a separate Google account or Apple Account made for testing, never someone's own. See test accounts.
- No real payment cards, contacts or photos. Turn off syncing of contacts, photos and passwords from any account on it.
- Trust only your lab computer. USB debugging on Android and Trust This Computer on an iPhone let a computer control the phone. Plug it only into the computer that runs your tests.
- Turn off what you don't use. Wireless debugging on Android stays off unless you pair the phone over Wi-Fi.
- Keep it where only your team can reach it. A test device is often left unlocked on a desk. Anyone who picks it up can use it, so keep nothing on it worth taking.
- Label it. A sticker that says it's a test device stops someone using it as their own.
Testing on someone's own phone
You don't need a spare phone to start. A personal phone can be tested on if the test never touches its owner's browser:
- iPhone: Safari tests in its own automation window, separate from the owner's tabs, and everything it held is deleted when the test ends.
- Android: tests run in Chrome Beta, a separate app with its own data, so the owner's Chrome is never opened or cleared. Install Chrome Beta from the Play Store first.
The phone has to be awake and unlocked while the test runs, because nothing should change its lock settings.
When a test device is retired
- Remove the computers it trusts: on Android, Settings › System › Developer options › Revoke USB debugging authorizations; on an iPhone, Settings › General › Transfer or Reset iPhone › Reset › Reset Location & Privacy.
- Sign out of every account on it. On an iPhone, turn off Find My first, or the next owner can't set it up.
- Erase it: Settings › System › Reset options › Erase all data on Android, or Settings › General › Transfer or Reset iPhone › Erase All Content and Settings.
With PocketQA
When you plug in a phone, PocketQA asks whose phone it is. A testing phone starts with each change PocketQA can make ticked: on Android, kept awake while it charges, a 30-minute screen timeout and Chrome's data cleared between tests; on an iPhone, a stuck Safari closed. Untick any of them. On a Pixel with Android 15 or newer, stopping at 80% is one of the boxes too. A personal phone changes nothing, and is tested in a separate browser. You can change any of this later from the phone's own page.