Devices
Manage devices
Start, stop and control a phone, and know what each state means.
States
| State | Meaning |
|---|---|
| starting | Being created, started or restarted. A job is running for it. |
| running | On and reachable from the dashboard, the API and ADB. |
| error | Running, but its last health check failed. |
| stopped | Off. Apps and data are kept. |
Start, stop and delete
GET /v1/devices # your phones POST /v1/devices/{name}/start POST /v1/devices/{name}/stop POST /v1/devices/{name}/restart DELETE /v1/devices/{name} # for good
Start, stop and restart answer 202 with a job; follow it with GET /v1/jobs/{id}. Delete removes the phone and its data and cannot be undone. Starting a phone that has been stopped for a while can take a couple of minutes.
Screenshots and single steps
GET /v1/devices/{name}/screenshot?w=540 # PNG, or a smaller JPEG with w
POST /v1/devices/{name}/action {"op":"open_app","package":"com.android.chrome"}action runs one step: open_app, close_app, url, tap, swipe, text, key, scroll, and the text helpers find_text, tap_text, wait_text, screen_text. For an agent loop use Observe and act.
Names
Every phone has an API name such as c3f9a41d2, a label (its name in the dashboard, or "Model #N") and a number. Rename a phone with POST /v1/devices/{name}/label.