Skip to main content

LongPress

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.

LongPress​

public void LongPress(string target)
public void LongPress(string target, TimeSpan duration)

Presses and holds an element.

Presses and holds an element for a given time.

Examples​

Press and hold for two seconds​

device.LongPress("@e4", TimeSpan.FromSeconds(2));

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