Swipe or scroll
android_swipePerforms swipe gestures between two points to scroll lists, dismiss items, or drag elements on an Android device.
Instructions
Swipe between two points. Used for scrolling, dismissing, and drag gestures.
To scroll a list down (revealing content further down), swipe from a lower y to a higher one — the finger moves up.
Args:
x1, y1 (number): start point in pixels
x2, y2 (number): end point in pixels
duration_ms (number): gesture duration; longer is a drag, shorter is a fling (default: 300)
serial (string, optional): target device
Returns: { "from": [number, number], "to": [number, number], "durationMs": number, "serial": string }
Examples:
Use when: scrolling a list down -> x1=540, y1=1600, x2=540, y2=600
Use when: dragging an item -> duration_ms=1000
Don't use when: a single tap is enough (use android_tap)
Error Handling:
A swipe that is too fast to register is the usual cause of "nothing happened"; raise duration_ms
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | Yes | Start x in pixels. | |
| x2 | Yes | End x in pixels. | |
| y1 | Yes | Start y in pixels. | |
| y2 | Yes | End y in pixels. | |
| serial | No | Device serial from android_list_devices. Optional when exactly one device is connected; required when several are. | |
| duration_ms | No | Gesture duration in milliseconds. |