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
func (d *Device) LongPress(ctx context.Context, target string, duration time.Duration) error
LongPress presses and holds an element. A zero duration uses the default.
Examples
Press and hold for two seconds
if err := dev.LongPress(ctx, "@e4", 2*time.Second); err != nil {
return err
}
On a device
| Before | After |
|---|---|
![]() | ![]() |
mobium long-press testid=pressTarget on an Android 15 emulator

