ACC Logo
ADBDebuggingSafe

adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]

Simulate swipe / drag gesture

What It Does

Simulates a finger drag or swipe motion from starting coordinates (x1, y1) to ending coordinates (x2, y2). Useful for scrolling and drag-and-drop.

Command Syntax
Terminal
$adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]
Parameters & Placeholders Breakdown

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 Coordinate

The horizontal pixel coordinate (X-axis) from the top-left corner of the touchscreen.

Real-world value:540
Command syntax: adb shell input tap 540 1200
<y1>Vertical Screen Coordinate

The vertical pixel coordinate (Y-axis) from the top-left corner of the touchscreen.

Real-world value:1200
Command syntax: adb shell input tap 540 1200
<x2>Horizontal Screen Coordinate

The horizontal pixel coordinate (X-axis) from the top-left corner of the touchscreen.

Real-world value:540
Command syntax: adb shell input tap 540 1200
<y2>Vertical Screen Coordinate

The vertical pixel coordinate (Y-axis) from the top-left corner of the touchscreen.

Real-world value:1200
Command syntax: adb shell input tap 540 1200
[duration_ms]DURATION MS Parameter

Replace this placeholder with your specific duration ms value.

Real-world value:your-duration_ms
Command syntax: adb shell input swipe <x1> <y1> <x2> <y2> your-duration_ms
Usage Examples
$adb shell input swipe 540 1600 540 400 300
$adb shell input swipe 540 400 540 1600 300
Options & Flags
Flag / ParameterDescription
[duration_ms]Duration of gesture in milliseconds. High values (e.g. 1500) act as long-presses.
Prerequisites & Requirements
  • Screen turned on
Related Commands
Found an error or missing flag for adb shell input swipe <x1> <y1> <x2> <y2> [duration_ms]?

Submit a correction or request additional examples on GitHub.

Having issue? Contact @mkr_infinity

Direct technical assistance & ROM flashing troubleshooting by Mohammad Kaif Raja.

Contact @mkr_infinity