adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]
Simulate swipe / drag gesture
Simulates a finger drag or swipe motion from starting coordinates (x1, y1) to ending coordinates (x2, y2). Useful for scrolling and drag-and-drop.
adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]This command syntax includes specific placeholder tokens. Below is an explanation of what each word represents and concrete real-world values to replace it with:
<x1>Horizontal Screen CoordinateThe horizontal pixel coordinate (X-axis) from the top-left corner of the touchscreen.
adb shell input tap 540 1200<y1>Vertical Screen CoordinateThe vertical pixel coordinate (Y-axis) from the top-left corner of the touchscreen.
adb shell input tap 540 1200<x2>Horizontal Screen CoordinateThe horizontal pixel coordinate (X-axis) from the top-left corner of the touchscreen.
adb shell input tap 540 1200<y2>Vertical Screen CoordinateThe vertical pixel coordinate (Y-axis) from the top-left corner of the touchscreen.
adb shell input tap 540 1200[duration_ms]DURATION MS ParameterReplace this placeholder with your specific duration ms value.
adb shell input swipe <x1> <y1> <x2> <y2> your-duration_msadb shell input swipe 540 1600 540 400 300adb shell input swipe 540 400 540 1600 300| Flag / Parameter | Description |
|---|---|
| [duration_ms] | Duration of gesture in milliseconds. High values (e.g. 1500) act as long-presses. |
- Screen turned on
adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]?Submit a correction or request additional examples on GitHub.
Direct technical assistance & ROM flashing troubleshooting by Mohammad Kaif Raja.