Skip to content
karagöz docs

karagoz swipe

Moves one finger from (x1, y1) to (x2, y2).

  • Android emulator Done
  • Android device Done
  • iOS simulator Done
  • iOS device Done
~/app
karagoz swipe <x1> <y1> <x2> <y2> [--duration <ms>] [--device <id>]
  • 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.
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
~/app
karagoz swipe 540 1800 540 600
{"device":"emulator-5554","x1":540,"y1":1800,"x2":540,"y2":600,"duration":300}exit 0
{
"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.

device string
Serial, or the simulator's or iPhone's UDID.
x1 number
The finger moves from (x1, y1) to (x2, y2). Screen pixels, same rules as tap.
y1 number
The finger moves from (x1, y1) to (x2, y2). Screen pixels, same rules as tap.
x2 number
The finger moves from (x1, y1) to (x2, y2). Screen pixels, same rules as tap.
y2 number
The finger moves from (x1, y1) to (x2, y2). Screen pixels, same rules as tap.
duration number
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.

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

A swipe can get INVALID_ARGS, INPUT_BLOCKED, the device selection errors and the adb errors.

On a simulator, as for tap:

On an iPhone, the errors of tap on an iPhone.

MCP equivalentswipe {"x1":540,"y1":1800,"x2":540,"y2":600}MCP tools

Arguments: x1, y1, x2, y2 (required), duration, device. The names are the CLI's option and positional names.

karagoz tap
Its iOS sections list the errors swipe gets on a simulator and on an iPhone.