diff --git a/api/device-sessions.md b/api/device-sessions.md index 7c68e0c..51d5929 100644 --- a/api/device-sessions.md +++ b/api/device-sessions.md @@ -20,7 +20,7 @@ A session is named by its `id` (for example `brave-teal-otter`) in every path. E |---|---| | `POST /device/sessions/:id/install` | Install a build: `{ "binaryUploadId": "..." }`, or `{ "url": "https://..." }` for an `.apk` or a zipped simulator `.app` at a link (up to 500 MB). It installs in the background. A command sent meanwhile waits up to 45 s for it, then answers `LIVE_NOT_READY` | | `POST /device/sessions/:id/launch` | Launch an app: `{ "appId"?: "...", "clearState"?: true }`. Without `appId`, the installed build | -| `POST /device/sessions/:id/actions` | One action: `tap` (`x`/`y` percent, `text` or `id`), `type` (`text`, and `sensitive: true` to keep it secret), `swipe` (`direction`: `up`, `down`, `left` or `right`, or `from`/`to` points in percent), `press_key` (`key`: `back`, `home`, `enter`, `backspace`, `tab`, `volume_up`, `volume_down`, `lock` or `power`) | +| `POST /device/sessions/:id/actions` | One action: `tap` (`x`/`y` percent, `text` or `id`), `type` (`text`, and `sensitive: true` to keep it secret), `swipe` (`direction`: `up`, `down`, `left` or `right`, or `from`/`to` points in percent), `press_key` (`key`: `back`, `home`, `enter`, `backspace`, `tab`, `volume_up`, `volume_down`, `lock` or `power`). Performed on the device directly and answered once the screen has settled, usually well under a second; `text` and `id` are matched whole, ignoring case. `mode: "maestro"` runs it as a Maestro flow instead. A `tap` on something that is not on screen waits about 17 s before it fails | | `POST /device/sessions/:id/run` | Run Maestro: `{ "yaml": "..." }` for one flow, or `{ "flowUploadId": "...", "flow"?: "..." }` for a [flow bundle](#flow-bundles). `env` passes [secrets and variables](#secrets). Waits up to 110 s, or `waitSeconds` (0 to 300), then answers `running` with a `command_id`. A failed run's result includes `screen_text`, the app's visible text after the failure | | `GET /device/sessions/:id/commands/:commandId` | The status and result of a `run` that answered `running`. `?waitSeconds=` (0 to 300) waits for it to finish instead of answering at once | | `GET /device/sessions/:id/inspect` | The screen as compact JSON. The on-screen keyboard and the System UI are left out unless you add `?all=true` | diff --git a/cli/dcd-device.md b/cli/dcd-device.md index 94539a4..ae88ad8 100644 --- a/cli/dcd-device.md +++ b/cli/dcd-device.md @@ -16,6 +16,8 @@ A typical session: dcd device start --platform ios --app ./build/MyApp.app --wait dcd device launch dcd device inspect +dcd device tap --text "Log in" +dcd device type --text "ann@example.com" dcd device run flows/login.yaml dcd device screenshot -o after-login.jpg dcd device stop @@ -95,6 +97,31 @@ The screen as compact JSON: each element with its text, id, accessibility label Save a screenshot. `-o ` sets where (default `./-