gesture-swipe
Performs swipe or drag touch gestures between two screen points on iOS simulators, physical devices, or Android emulators to scroll lists, dismiss modals, drag elements, or navigate pages.
Instructions
Execute a smooth swipe / drag touch gesture between two points on the device (iOS simulator or physical device, or Android emulator). All from/to positions are fractions of screen width/height (not pixels), same as gesture-tap. Generates interpolated Move events for a natural feel (~60fps). Swipe up (fromY > toY) to scroll content down. Use when you need to scroll a list, dismiss a modal, drag an element, or navigate between pages. Not supported on Chromium; use gesture-scroll there instead. Physical iOS: an edge gesture (back-swipe) needs fromX 0 exactly; durationMs sets drag speed, not time; momentum:false only rests 300ms at the end and does not damp. Returns { swiped: 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.
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>",
"fromX": "<fromX>",
"fromY": "<fromY>",
"toX": "<toX>",
"toY": "<toY>"
},
"name": "gesture-swipe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toX | Yes | End x. Range: 0 to 1. | |
| toY | Yes | End y. Range: 0 to 1. | |
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| fromX | Yes | Start x. Range: 0 to 1. | |
| fromY | Yes | Start y. Range: 0 to 1. | |
| momentum | No | Whether the swipe releases with momentum; default true (a natural flinging swipe). false eases the finger into the end point so the OS applies little to no fling and the content stops where the finger lifts: use it when you need a deterministic scroll distance, e.g. in scroll-to-element loops. false needs durationMs >= 150 and is rejected below that; near 150 it can still land short or fling, so keep the default 300. | |
| durationMs | No | Total gesture duration in milliseconds (default 300); the finger stays down this long. Below ~32ms the whole travel lands in one or two frames, which the OS flings as hard as any flick. Maximum: 10000. |