Skip to main content

app_press_drag

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

Press and drag: one finger holds an element while a second finger drags from one place to another, and the first lifts only after the second has. Not app_drag, which is one finger carrying something; here the held finger anchors and the other moves. Give hold, from and to as refs or locators, or x1,y1 (hold), x2,y2 (from) and x3,y3 (to). It reports that the gesture was delivered: call app_map again to see what it did. Android 15 and earlier only, for app_press_tap's reasons. Discards the refs from the last app_map.

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_msintegerHow long the second finger's travel takes, in milliseconds. Defaults to 600.
fromstringA ref or locator where the second finger lands.
holdstringA ref or locator for what the first finger holds.
lead_msintegerHow long the first finger rests before the second lands, in milliseconds. Defaults to 300, under Android's long-press timeout.
tostringA ref or locator where the second finger lifts.
x1integerHeld point, X in device pixels. Instead of hold.
x2integerSecond finger's start, X. Instead of from.
x3integerSecond finger's end, X. Instead of to.
y1integerHeld point, Y in device pixels.
y2integerSecond finger's start, Y.
y3integerSecond finger's end, Y.

Examples​

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

Hold one thing and drag another​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_press_drag",
"arguments": {
"hold": "@e3",
"from": "@e5",
"to": "@e9"
}
}
}

On a device​

mobium press-drag 'label=Hold zone' 'label=Act zone' 'label=Drag end' on an Android 15 emulator

mobium press-drag 'label=Hold zone' 'label=Act zone' 'label=Drag end' on an Android 15 emulator