Skip to main content

swipe

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Swipe the screen. These call app_swipe.

swipe​

public void swipe(String direction)
public void swipe(String target, String direction)
public void swipe(int x1, int y1, int x2, int y2)

Drags across the middle of the screen: "up", "down", "left" or "right". The finger moves that way, so "up" scrolls a page down.

@param direction "up", "down", "left" or "right": the way the finger moves

Swipes across an element, after the checks a tap makes — part of the way, which reveals a list row's swipe actions without performing the first. Map again and tap the action you mean.

@param target a ref from map() or a locator @param direction "up", "down", "left" or "right": the way the finger moves

Drags between two points in device pixels.

@param x1 where the finger lands, horizontally, in device pixels @param y1 where the finger lands, vertically, in device pixels @param x2 where the finger lifts, horizontally, in device pixels @param y2 where the finger lifts, vertically, in device pixels

Examples​

Swipe up, to scroll the page down​

device.swipe("up");

The same call from the command line, mobium swipe up, printed on an Android 15 emulator:

swiped up: (540,1584) to (540,679)
BeforeAfter
Before: mobium swipe up on an Android 15 emulatorAfter: mobium swipe up on an Android 15 emulator

mobium swipe up on an Android 15 emulator