iOS Simulator: Swipe
ios_simulator_swipeDrag between two points on an iOS Simulator to scroll, pull to refresh, or swipe a row. Set duration for a controlled scroll or a fling, and get a screenshot to confirm the result.
Instructions
Drag from one point to another, in points — how you scroll a list, pull to refresh, or swipe a row open. To scroll down a page, swipe from low on the screen to high on it. duration_ms is what separates a scroll from a fling: a short one throws the list past where you aimed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to_x | Yes | Horizontal position in points, from the left edge. This is the same space as the `tap` field from ios_simulator_ui_tree and as a default ios_simulator_screenshot image — no conversion. | |
| to_y | Yes | Vertical position in points, from the top edge. Same space as ios_simulator_ui_tree `tap` and a default ios_simulator_screenshot image. | |
| device | No | Which simulator: its UDID or its name as shown by ios_simulator_list. Omit it when exactly one is booted — that is the normal case, and IOS_SIMULATOR_ID pins it when it is not. Unlike simctl's own `booted`, this never picks arbitrarily between two. | |
| from_x | Yes | Horizontal position in points, from the left edge. This is the same space as the `tap` field from ios_simulator_ui_tree and as a default ios_simulator_screenshot image — no conversion. | |
| from_y | Yes | Vertical position in points, from the top edge. Same space as ios_simulator_ui_tree `tap` and a default ios_simulator_screenshot image. | |
| settle_ms | No | Milliseconds to wait before the follow-up screenshot, so an animation finishes first. Raise it for a screen that loads data; a capture taken mid-transition shows neither state. This is a pause for an animation, not a wait for work to finish — which is why it stops at ten seconds. For anything longer, use ios_simulator_wait_for_element. | |
| screenshot | No | Return a screenshot of the resulting screen. On by default, and worth leaving on: it is how you find out that the action landed where you meant it to. Turn it off only for a sequence whose intermediate states you do not need to see. | |
| duration_ms | No | How long the drag takes. 400 is a controlled scroll; under 150 becomes a fling with momentum, which lands somewhere you did not choose. |