gesture-pinch
Simulate a two-finger pinch-to-zoom gesture on iOS Simulators or Android Emulators to zoom maps, images, or other zoomable views by moving fingers toward or away from a center point.
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. Positions and distances are fractions of the screen (0.0–1.0, not pixels), as in gesture-tap. 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. Use when you need to zoom in or out on a map, image, or zoomable view. Returns { pinched: true, timestampMs }. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if the simulator-server / emulator backend is not reachable for the given device, or on a physical iPhone when the app is not drawn in portrait.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"udid": "<udid>",
"centerX": "<centerX>",
"centerY": "<centerY>",
"startDistance": "<startDistance>",
"endDistance": "<endDistance>"
},
"name": "gesture-pinch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| angle | No | Angle in degrees of the axis the fingers lie on: 0 = horizontal (default), 90 = vertical. | |
| centerX | Yes | Center of the pinch, horizontal. | |
| centerY | Yes | Center of the pinch, vertical. | |
| durationMs | No | Total gesture duration in milliseconds (default 300) | |
| endCenterX | No | Final horizontal center of the pinch. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center. | |
| endCenterY | No | Final vertical center of the pinch; drifts from centerY like endCenterX. Omit for a fixed center. | |
| endDistance | Yes | Final distance between the two fingers. | |
| startDistance | Yes | Initial distance between the two fingers. |