Skip to main content

long_press

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

Press and hold an element or a point — the gesture that opens context menus and starts drag-and-drop. These call app_long_press.

long_press​

def long_press(target: str | None=None, x: int | None=None, y: int | None=None, duration_ms: int=800) -> None

Press and hold an element or a point.

Examples​

Press and hold for two seconds​

device.long_press("@e4", duration_ms=2000)

On a device​

BeforeAfter
Before: mobium long-press testid=pressTarget on an Android 15 emulatorAfter: mobium long-press testid=pressTarget on an Android 15 emulator

mobium long-press testid=pressTarget on an Android 15 emulator