Skip to main content
Every DCP method, grouped by capability domain. A command is { "id", "method", "params" }; the response echoes the id and carries result on success or error on failure. Coordinates are pixels in the phone’s native resolution (read it from Device.info). A phone advertises the methods it supports in the handshake — check capabilities before you depend on a method rather than assuming the whole surface.

Protocol

Protocol.handshake

Negotiate the protocol and discover what the phone supports. Send it once, right after you open the socket, and repeat it after every reconnect before sending more work.
Result

Device

Device.info

The static device descriptor — read it to size taps and swipes without a screenshot round trip.
Result

Touch

Touch.tap

Tap a pixel.
Result — an empty object {}.

Touch.longPress

Press and hold a pixel.
Result — an empty object {}.

Touch.swipe

Swipe from one pixel to another.
Result — an empty object {}.

Keyboard

Keyboard.typeText

Type a string into the focused field.
Result — an empty object {}.

Keyboard.keyPress

Press a supported named key. Raw DCP accepts enter and capslock; the CLI and SDKs expose Enter as their customer-facing named key. Use Keyboard.typeText for printable text.
Result — an empty object {}.

Screen

Screen.screenshot

Capture the current frame as a PNG.
Result

Screen.observe

Read the screen — its text and icons, with bounding boxes.
Result

Locator

Each Locator method finds its target on the current frame, waits until the target is ready, then acts or answers, all on the phone side in one round trip. A locator is an object of target fields that combine as AND: Plain text resolves by OCR; anything more uses one vision-model call. The contract also defines role, name, id, states, and platform. They need the phone’s accessibility tree, which phones don’t expose yet, so they fail with StrategyUnavailable. Every Locator method accepts these params alongside its own: When the target never becomes ready within timeoutMs, the call fails with ActionTimeout. Most results are a LocatorResult:

Locator.tap

Wait for the target, then tap its center.
Also takes idempotencyKey. Result — a LocatorResult.

Locator.fill

Wait for the target, tap it to focus, then type text into it.
Requires text; also takes idempotencyKey. Result — a LocatorResult.

Locator.press

Press a named key: "enter" or "capslock". With a locator, the target is found, waited for, and focused first; without one, the key goes to whatever has focus.
Requires key; also takes idempotencyKey. Result — a LocatorResult; resolvedBy and bounds are present only when the press carried a locator.

Locator.waitFor

Wait until the target reaches a state, re-checking each fresh frame. One call replaces a client-side polling loop.
state is "visible" (the default) or "hidden". Result — a LocatorResult; resolvedBy and bounds are absent for "hidden".

Locator.boundingBox

Wait for the target, then return where it is.
Result — a LocatorResult.

Locator.text

Wait for the target, then return its recognized text.
Result — a LocatorResult plus text (string).

Locator.count

Count the matches on the current screen, zero included. Never waits.
Result — count (integer), resolvedBy, and tookMs. Customer-billed cost is available from the session’s retained Telemetry response, not from the DCP result.

Errors

A failed command answers with error instead of result:
data.kind is the machine-readable classification and data.retryable says whether retrying the same command could succeed:

Next steps

Drive a phone with raw DCP

A worked example, socket to first command.

Protocol overview

How the wire is framed and why.

Reconnect and resume

Close classes, cursor replay, resync, and idempotency keys.

Use the SDK instead

The ergonomic driver over these methods.

Vision models

Model ids and pricing for Locator descriptions.