Input & Automation Android 4.0+ Risk: SAFE

Simulate Screen Swipe / Scroll / Drag

Simulates a finger swipe gesture between two coordinate pairs with optional duration in milliseconds.

Command Syntax

adb shell input swipe
Generic Syntax: input swipe <X1> <Y1> <X2> <Y2> [<DURATION_MS>]

Options & Parameters

Flag Description
<X1> <Y1> <X2> <Y2> Start and end coordinates in pixels.
[DURATION_MS] Duration of the swipe motion in milliseconds (default 300ms).

Real-World Usage Examples

Swipe down to pull notification shade
Swipes from top to middle.
adb shell input swipe 500 50 500 1200 300
Long press at coordinate (2000ms duration)
Performs 2-second long press.
adb shell input swipe 540 1200 540 1200 2000