gesture-pinch
Simulate a pinch-to-zoom gesture on maps, images, or zoomable views. Specify center point and finger distances to zoom in or out; returns confirmation with timestamp.
Instructions
Execute a pinch-to-zoom gesture by moving two fingers toward or away from a center point to change the scale of on-screen content. All positions and distances are normalized 0.0–1.0 (fractions of screen width/height, not pixels)—same coordinate space as gesture-tap and gesture-swipe. startDistance > endDistance = pinch in (zoom out). startDistance < endDistance = pinch out (zoom in). Typical values: startDistance 0.2, endDistance 0.6 for a zoom-in pinch at screen center. Auto-generates interpolated frames at ~60fps. The angle parameter controls the axis (0 = horizontal, 90 = vertical). Use when you need to zoom in or out on a map, image, or zoomable view. Returns { pinched: true, timestampMs }. Fails if the simulator-server / emulator backend is not reachable for the given device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| angle | No | Axis angle in degrees along which the fingers are placed (default 0 = horizontal). | |
| centerX | Yes | Center of pinch, horizontal: normalized 0.0–1.0 (fraction of screen width, not pixels) | |
| centerY | Yes | Center of pinch, vertical: normalized 0.0–1.0 (fraction of screen height, not pixels) | |
| durationMs | No | Total gesture duration in milliseconds (default 300) | |
| endDistance | Yes | Final distance between the two fingers: normalized 0.0–1.0 (fraction of screen, not pixels). E.g. 0.6 = fingers 60% of screen apart. Use a larger endDistance than startDistance to pinch out (zoom in). | |
| startDistance | Yes | Initial distance between the two fingers: normalized 0.0–1.0 (fraction of screen, not pixels). E.g. 0.2 = fingers 20% of screen apart. Use a larger startDistance than endDistance to pinch in (zoom out). |