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​

func (d *Device) PressDrag(ctx context.Context, hold, from, to string) error

PressDrag holds one element with a finger while a second finger drags from one element to another. Not Drag, which is one finger carrying something: here one finger anchors and the other moves. Android 15 and earlier only, for PressTap's reasons.

Examples​

Hold one thing and drag another​

if err := dev.PressDrag(ctx, "@e3", "@e5", "@e9"); err != nil {
return err
}

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