gesture-swipe
Simulate a swipe or drag gesture between two points on iOS simulators or Android emulators. Use to scroll content, dismiss modals, or drag elements in app testing.
Instructions
Execute a smooth swipe / drag touch gesture between two points on the device (iOS simulator or Android emulator). All from/to positions are normalized 0.0–1.0 (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. Pass settle:true for a momentum-free swipe that lands exactly where the finger lifts (no fling), when you need a deterministic scroll distance. Returns { swiped: true, timestampMs }. Fails if the simulator-server / emulator backend is not reachable for the given device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toX | Yes | End x: normalized 0.0–1.0 (not pixels; same as tap) | |
| toY | Yes | End y: normalized 0.0–1.0 (not pixels; same as tap) | |
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| fromX | Yes | Start x: normalized 0.0–1.0 (not pixels; same as tap) | |
| fromY | Yes | Start y: normalized 0.0–1.0 (not pixels; same as tap) | |
| settle | No | Momentum-free swipe: decelerate into the end point (ease-out) so the OS reads ~0 release velocity and applies little to no fling. Use for scroll-to-element loops; default false (a natural flinging swipe). | |
| durationMs | No | Total gesture duration in milliseconds (default 300) |