Skip to main content

app_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.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
duration_msintegerHold time; default 800. Default 800.
targetstringA ref from app_map ("@e5") or a locator.
xintegerX in device pixels, instead of target.
yintegerY in device pixels, instead of target.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Press and hold for two seconds​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_long_press",
"arguments": {
"target": "@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