karagoz swipe
Moves one finger from (x1, y1) to (x2, y2).
- Android emulator Done
- Android device Done
- iOS simulator Done
- iOS device Done
karagoz swipe <x1> <y1> <x2> <y2> [--duration <ms>] [--device <id>]Before you start
Section titled “Before you start”- On Android, for input to reach apps: the screen unlocked.
- On an iOS simulator: Xcode 27 or newer, opened once.
- On an iPhone: paired with the Mac, Developer Mode on, connected by USB cable, Settings > Developer > Enable UI Automation on, and Karagöz’s runner installed with
install-runner.
Options
Section titled “Options”| Option | Default | Meaning |
|---|---|---|
<x1> <y1> <x2> <y2> |
Screen pixels, same rules as tap. |
|
--duration <ms> |
300 |
Time from start to end. Whole milliseconds, 0 to 999999999. |
--device <id> |
see Device selection |
Examples
Section titled “Examples”Swipe between two points
Section titled “Swipe between two points”karagoz swipe 540 1800 540 600{"device":"emulator-5554","x1":540,"y1":1800,"x2":540,"y2":600,"duration":300}exit 0Output
Section titled “Output”{ "device": "27024DC1-EDB0-4BF2-8010-08FE3936BAB6", "x1": 603, "y1": 2228, "x2": 603, "y2": 917, "duration": 300}On an iOS simulator the arguments and output are the same, with the same default duration. On an iPhone too, through Karagöz’s runner.
devicestring- Serial, or the simulator's or iPhone's UDID.
x1number- The finger moves from
(x1, y1)to(x2, y2). Screen pixels, same rules astap. y1number- The finger moves from
(x1, y1)to(x2, y2). Screen pixels, same rules astap. x2number- The finger moves from
(x1, y1)to(x2, y2). Screen pixels, same rules astap. y2number- The finger moves from
(x1, y1)to(x2, y2). Screen pixels, same rules astap. durationnumber- Time from start to end, in whole milliseconds. Always present, including the default
300.
On an iPhone the duration is played as given.
The first of ui-tree, tap, swipe, text or key on a simulator compiles a small helper, which takes a few seconds.
Duration matters
Section titled “Duration matters”A fast swipe flings a list and a slow one drags it:
--duration |
Android, 1200 px drag: further scroll after the finger lifts | iPhone, 1398 px drag up a list: how far the list moves |
|---|---|---|
| 300 ms | 1059 px | flung out of view |
| 1000 ms | 131 px | 1318 px |
| 3000 ms | 19 px | 1354 px |
Errors
Section titled “Errors”A swipe can get INVALID_ARGS, INPUT_BLOCKED, the device selection errors and the adb errors.
On a simulator, as for tap:
NOT_SUPPORTEDwith Xcode 26 or older.DEVICE_NOT_READYwhen the input service does not answer within 4 s (a simulator that has just booted).HELPER_FAILED.
On an iPhone, the errors of tap on an iPhone.
MCP equivalent
Section titled “MCP equivalent”Arguments: x1, y1, x2, y2 (required), duration, device. The names are the CLI's option and positional names.
Related commands
Section titled “Related commands”- karagoz tap
- Its iOS sections list the errors swipe gets on a simulator and on an iPhone.