Skip to main content

pressDrag

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. These call app_press_drag.

pressDrag​

public void pressDrag(String hold, String from, String to)

Holds one element with a finger while a second finger drags from one element to another. Not drag(String, String), which is one finger carrying something: here one finger anchors and the other moves. Android 15 and earlier only, for pressTap's reasons.

@param hold what the first finger holds: a ref from map() such as "@e5", or a locator such as "text=Sign in" @param from where the second finger starts: a ref or a locator @param to where the second finger ends: a ref or a locator

Examples​

Hold one thing and drag another​

device.pressDrag("@e3", "@e5", "@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