device_tap
Tap at (x,y) coordinates on a device screen. Coordinates are in DEVICE TAP-COORD SPACE (the "Tap-coord space" dims printed in the device_screenshot footer; same space as device_page_source bounds). First call starts a device control session (~3s).
COORDINATE SOURCES — in priority order:
PRIMARY: device_page_source bounds [L,T][R,B] (or the "Labeled elements" block bundled with device_screenshot) → tap center = ((L+R)/2, (T+B)/2). NO scaling. Pixel-exact.
FALLBACK ONLY (element not in page_source — image-only widget / custom Canvas): visual estimate from the screenshot pixels, scaled with the formula below.
VISUAL → TAP COORDINATE FORMULA (Android):
scale = device_width / rendered_chat_width
tap_x = visual_x × scale
tap_y = visual_y × scale
where device_width is the "Tap-coord space" width from the device_screenshot footer and rendered_chat_width is the "Image" width from the same footer. Both axes share one scale (aspect preserved). The footer prints concrete values per device — never assume any constant.
Skipping the scale on a visual estimate is the #1 cause of taps landing in the wrong place — the agent sees a downscaled image but device_tap expects full-resolution tap-space coords.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X coordinate in device tap-coord space (NOT visual screenshot pixels — apply scale = device_width / rendered_chat_width if you started from a visual estimate) | |
| y | Yes | Y coordinate in device tap-coord space (NOT visual screenshot pixels — apply scale = device_width / rendered_chat_width if you started from a visual estimate) | |
| udid | Yes | Device serial number (UDID) |