gesture-rotate
Rotate on-screen content by a specified angle using a two-finger circular arc gesture. Use for maps, image pickers, or any rotatable UI element.
Instructions
Send a two-finger circular arc gesture to rotate on-screen content by a specified angle. Two fingers are placed opposite each other at a fixed radius from the center, then swept from startAngle to endAngle degrees. All positions and radii are normalized 0.0–1.0 (fractions of screen width/height, not pixels)—same coordinate space as gesture-tap and gesture-swipe. endAngle > startAngle = clockwise rotation. Typical values: radius 0.15, startAngle 0, endAngle 90 for a 90° clockwise turn. A single radius applies to both axes, so on a non-square screen it traces a physical ellipse (finger separation varies through the turn); pass radiusX+radiusY (fractions of width/height with radiusX·width = radiusY·height) for a physically circular orbit instead. Auto-generates interpolated frames at ~60fps. Unlike gesture-pinch which moves fingers linearly to zoom, this orbits fingers in an arc to change orientation. Use when you need to rotate a map, image picker, or any rotateable UI element. Returns { rotated: 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). | |
| radius | No | Distance from center to each finger: normalized 0.0–1.0 (fraction of screen, not pixels). E.g. 0.15 = fingers placed 15% of screen away from center. One value for both axes, so on a non-square screen the orbit is a physical ellipse — pass radiusX+radiusY instead for a true circle. Required unless radiusX and radiusY are given. | |
| centerX | Yes | Center of rotation, horizontal: normalized 0.0–1.0 (fraction of screen width, not pixels) | |
| centerY | Yes | Center of rotation, vertical: normalized 0.0–1.0 (fraction of screen height, not pixels) | |
| radiusX | No | Per-axis finger distance, horizontal: normalized 0.0–1.0 fraction of screen WIDTH. Give both radiusX and radiusY (they override radius) with radiusX·screenWidth = radiusY·screenHeight for a physically circular orbit — constant finger separation, no pinch coupled into the turn. | |
| radiusY | No | Per-axis finger distance, vertical: normalized 0.0–1.0 fraction of screen HEIGHT. Always paired with radiusX — see radiusX. | |
| endAngle | Yes | Ending angle in degrees. endAngle > startAngle = clockwise. | |
| durationMs | No | Total gesture duration in milliseconds (default 300) | |
| startAngle | Yes | Starting angle in degrees (0 = right, 90 = down) |