device_pinch
Two-finger pinch-to-zoom centred at (x,y) on an Android device. scale > 1 zooms IN (fingers spread), scale < 1 zooms OUT (fingers converge); ~2 doubles, ~0.5 halves. Both fingers ride a VERTICAL axis through the centre, so the centre governs where they land: put it on the content you want to zoom, ideally the middle third of the screen. A centre near the top or bottom leaves no room — the span is squeezed to fit the content area and the zoom comes out weak or does nothing. Fingers are kept clear of the status and navigation bars; a finger in the status bar pulls down the notification shade instead of touching the app. Bottom sheets, dialogs and cards are app UI and cannot be detected here: if one covers the lower half, centre the pinch above it or the sheet swallows the gesture. The reply reports the finger endpoints and span actually used — if the screen did not change, check those before retrying. Coordinates are PHYSICAL pixels — same as the bounds in device_page_source.Pass input="hid" to require the virtual touchscreen: the gesture then reaches the app as real kernel input and fails loudly instead of silently falling back to injected input. That strict path used to be device_uhid_pinch, which stays callable under its old name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Pinch centre X | |
| y | Yes | Pinch centre Y | |
| udid | Yes | Device serial number (UDID) | |
| input | No | Input path. 'auto' (default) prefers the virtual touchscreen and falls back to injected input. 'hid' requires the virtual touchscreen and fails if the device does not provide one — use it when the gesture must be real kernel input or must fail loudly. | |
| scale | Yes | End/start finger-separation ratio: >1 zoom in, <1 zoom out (0.2-5) | |
| duration | No | Gesture duration in ms (default: 300) |