gesture-custom
Dispatch a custom sequence of touch events to perform complex gestures such as long press, drag-and-drop, custom scrolling, or two-finger pinch on a connected device.
Instructions
Send a sequence of touch events for complex gestures. Use for: long press, drag-and-drop, custom scroll, pinch (second touch point). For simple taps use the gesture-tap tool. For straight-line scrolling use the gesture-swipe tool. For pinch gestures use gesture-pinch. For rotation gestures use gesture-rotate. On a local iOS simulator, set edge to the starting side for a system gesture. To move a full-screen app into Split View on an open Duo, set edge:"bottom". In one continuous contact move from bottom center to center, pause there, drag to the requested side, and release. See the device-interact foldables reference for coordinates and timing. All x/y values are fractions of the screen width/height (not pixels). Physical iOS: a Down, any Moves, then an Up; x2/y2 adds a second finger. A plain Down then Up: same point = press-hold, other point = drag (Up delayMs = rest before the move); one Move at the Down point between them = long-press pickup (Move delayMs = hold, Up delayMs = move time). Any other train plays as timed paths, each event waiting its delayMs, and needs the app drawn in portrait. Returns { events: number } with the total count of events dispatched. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if the target device is not booted or an event type is invalid.
Example long-press at center: [{"type":"Down","x":0.5,"y":0.5},{"type":"Up","x":0.5,"y":0.5,"delayMs":800}]
Example pick up a list item with a long press, then drag it up: [{"type":"Down","x":0.5,"y":0.6},{"type":"Move","x":0.5,"y":0.6,"delayMs":800},{"type":"Up","x":0.5,"y":0.3,"delayMs":500}]
Example smooth scroll down: [{"type":"Down","x":0.5,"y":0.7}, {"type":"Move","x":0.5,"y":0.6},{"type":"Move","x":0.5,"y":0.5},{"type":"Move","x":0.5,"y":0.4}, {"type":"Up","x":0.5,"y":0.3}]
Example pinch-to-zoom (with interpolate:10 for smoothness): events: [{"type":"Down","x":0.4,"y":0.5,"x2":0.6,"y2":0.5}, {"type":"Up","x":0.2,"y":0.5,"x2":0.8,"y2":0.5}] interpolate: 10
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>",
"events": "<events>"
},
"name": "gesture-custom"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edge | No | Starting edge in upright screen coordinates for a single-finger system gesture on a local iOS simulator. | |
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| events | Yes | Touch events, dispatched in order. | |
| interpolate | No | Number of Move events to insert between each pair of consecutive events, linearly interpolating both x,y and x2,y2 and splitting the delay evenly, for a smooth gesture. Default: no interpolation. |