Skip to content

Mastering ADB Input Commands


In this ASCII art

  • (500,0) marks the top-right corner of the screen.
  • (0,2300) marks the bottom-left corner of the screen.
  • (100,1150) marks a location towards the left-middle of the screen.
  • (250,1150) marks a location at the middle of the screen.
  • (1000,1000) marks a location a bit lower but more towards the right side.
Origin (0, 0)
+----------------------------------+
|  Status Bar   (500,0) X          |
|----------------------------------+
|                                  |
|                                  |
|                                  |
|  (100,1150) O                    |
|                                  |
|                                  |
|                                  |
|                                  |
|                                  | ---- O (250,1150)
|                                  |
|                                  |
|                                  |
|                                  |
|                                  || --- Power Button
|                                  |
|                                  |
|                                  |
|                                  |
|                                  |
|                                  |
|                                  || ---- O (1000,1000)
|                                  |
|                                  |
|              Antenna             |
|(0,2300) X                        |
------------------------------------ ---- Y(2300)
           100       300      500

New Tests after 2024-08-29

Power On -> Swipe Screen -> Unlock Lockscreen -> Unlocked

This is for unlocking the devivice as fast as possible without any sleep requirements

adb shell input swipe 250 1150 250 300;
adb shell input text <pincode>; 
adb shell input keyevent 66

Added before 2024-08-29

To tap on the center of the screen

adb shell input tap 250 1150

To tap on the Power button

adb shell input tap 150 350

To tap on the top-right corner of the screen

adb shell input tap 500 0

To tap on the bottom-left corner of the screen

adb shell input tap 0 2300

To tap on the middle-left of the screen

adb shell input tap 100 1150

To tap on the middle-right of the screen

adb shell input tap 400 1150

To simulate a swipe from the middle of the screen to the top (useful for scrolling)

adb shell input swipe 250 1150 250 300

To simulate a swipe from the middle of the screen to the bottom (also for scrolling)

adb shell input swipe 250 1150 250 2000

To simulate a long press at the middle of the screen (for context menus or similar functionality)

adb shell input swipe 250 1150 250 1150 2000

To simulate a pinch gesture (zoom out), we can use two swipe commands that start from different points and converge in the middle of the screen

adb shell input swipe 100 1000 250 1150 & adb shell input swipe 400 1300 250 1150

To simulate a spread gesture (zoom in), we can use two swipe commands that start from the same point in the middle of the screen and move towards different ends

adb shell input swipe 250 1150 100 1000 & adb shell input swipe 250 1150 400 1300

Tap on the top-left corner of the screen

adb shell input tap 0 0

Tap on the bottom-right corner of the screen

adb shell input tap 500 2300

Simulate a swipe from the bottom to the top of the screen (reverse scrolling)

adb shell input swipe 250 2000 250 300

Simulate a swipe from top to the bottom of the screen (reverse scrolling)

adb shell input swipe 250 300 250 2000

Simulate a long press at the top-left of the screen

adb shell input swipe 0 0 0 0 2000

Simulate a long press at the bottom-right of the screen

adb shell input swipe 500 2300 500 2300 2000

Simulate a drag gesture from the middle of the screen to the top-right

adb shell input swipe 250 1150 500 0

To simulate a drag gesture from the middle of the screen to the bottom-left

adb shell input swipe 250 1150 0 2300

To tap on a point in the upper-middle section of the screen

adb shell input tap 250 600

To tap on a point in the lower-middle section of the screen

adb shell input tap 250 1800

To simulate a swipe diagonally from the top-left to the bottom-right of the screen

adb shell input swipe 0 0 500 2300

To simulate a swipe diagonally from the top-right to the bottom-left of the screen

adb shell input swipe 500 0 0 2300

To simulate a swipe diagonally from the bottom-left to the top-right of the screen

adb shell input swipe 0 2300 500 0

To simulate a swipe diagonally from the bottom-right to the top-left of the screen

adb shell input swipe 500 2300 0 0
adb shell input swipe 0 1150 500 1150
adb shell input swipe 500 1150 0 1150

To simulate a tap on the "Back" button area (assuming it's at the bottom-left of the screen)

adb shell input tap 50 2250

To simulate a tap on the "Home" button area (assuming it's at the bottom-middle of the screen)

adb shell input tap 250 2250

To simulate a tap on the "Recent Apps" button area (assuming it's at the bottom-right of the screen)

adb shell input tap 450 2250

To simulate a swipe from the "Recent Apps" button to the middle of the screen (useful for opening the recent apps view)

adb shell input swipe 450 2250 250 1150

To simulate a swipe from the top to the middle of the screen (useful for pulling down the notification shade)

adb shell input swipe 250 0 250 1150

To simulate a swipe from the middle to the top of the screen (useful for pushing up the notification shade)

adb shell input swipe 250 1150 250 0

To simulate a long press on the "Home" button (useful for triggering Google Assistant or any other bound service)

adb shell input swipe 250 2250 250 2250 2000

To simulate a tap on the upper-middle-left of the screen (might be useful for some apps)

adb shell input tap 125 575

To simulate a tap on the upper-middle-right of the screen (might be useful for some apps)

adb shell input tap 375 575

To simulate a tap on the lower-middle-left of the screen (might be useful for some apps)

adb shell input tap 125 1725

To simulate a tap on the lower-middle-right of the screen (might be useful for some apps)

adb shell input tap 375 1725

To simulate a long press in the upper-middle-left of the screen

adb shell input swipe 125 575 125 575 2000

To simulate a long press in the upper-middle-right of the screen

adb shell input swipe 375 575 375 575 2000

To simulate a long press in the lower-middle-left of the screen

adb shell input swipe 125 1725 125 1725 2000

To simulate a long press in the lower-middle-right of the screen

adb shell input swipe 375 1725 375 1725 2000

To simulate a diagonal swipe from upper-middle-left to lower-middle-right of the screen

adb shell input swipe 125 575 375 1725

To simulate a diagonal swipe from upper-middle-right to lower-middle-left of the screen

adb shell input swipe 375 575 125 1725

To simulate a diagonal swipe from lower-middle-left to upper-middle-right of the screen

adb shell input swipe 125 1725 375 575

To simulate a diagonal swipe from lower-middle-right to upper-middle-left of the screen

adb shell input swipe 375 1725 125 575

To simulate a tap on the center of the status bar (useful for some quick settings)

adb shell input tap 250 50

To simulate a tap on the center of the antenna area (might be useful for some games or full-screen apps)

adb shell input tap 250 2250

To simulate a swipe from the center of the antenna area to the center of the screen (useful for some games or full-screen apps)

adb shell input swipe 250 2250 250 1150

To simulate a swipe from the center of the status bar to the center of the screen (useful for pulling down the notification shade)

adb shell input swipe 250 50 250 1150

To simulate a "zig-zag" swipe from the top-left to the bottom-right of the screen

adb shell input swipe 0 0 500 1150 & adb shell input swipe 500 1150 0 2300

To simulate a "zig-zag" swipe from the top-right to the bottom-left of the screen

adb shell input swipe 500 0 0 1150 & adb shell input swipe 0 1150 500 2300

To simulate a pinch gesture at the top of the screen

adb shell input swipe 125 300 250 600 & adb shell input swipe 375 300 250 600

To simulate a spread gesture at the top of the screen

adb shell input swipe 250 600 125 300 & adb shell input swipe 250 600 375 300

To simulate a pinch gesture at the bottom of the screen

adb shell input swipe 125 2000 250 1700 & adb shell input swipe 375 2000 250 1700

To simulate a spread gesture at the bottom of the screen

adb shell input swipe 250 1700 125 2000 & adb shell input swipe 250 1700 375 2000

To simulate a complex gesture (like drawing an "X" from corner to corner)

adb shell input swipe 0 0 500 2300 & adb shell input swipe 500 0 0 2300
adb shell input swipe 0 1150 500 1150
adb shell input swipe 500 1150 0 1150

To simulate a tap on the "Back" button area (assuming it's at the bottom-left of the screen)

adb shell input tap 50 2250

To simulate a tap on the "Home" button area (assuming it's at the bottom-middle of the screen)

adb shell input tap 250 2250

To simulate a tap on the "Recent Apps" button area (assuming it's at the bottom-right of the screen)

adb shell input tap 450 2250

To simulate a swipe from the "Recent Apps" button to the middle of the screen (useful for opening the recent apps view)

adb shell input swipe 450 2250 250 1150

To simulate a swipe from the top to the middle of the screen (useful for pulling down the notification shade)

adb shell input swipe 250 0 250 1150

To simulate a swipe from the middle to the top of the screen (useful for pushing up the notification shade)

adb shell input swipe 250 1150 250 0

To simulate a long press on the "Home" button (useful for triggering Google Assistant or any other bound service)

adb shell input swipe 250 2250 250 2250 2000

To simulate a tap on the upper-middle-left of the screen (might be useful for some apps)

adb shell input tap 125 575

To simulate a tap on the upper-middle-right of the screen (might be useful for some apps)

adb shell input tap 375 575

To simulate a tap on the lower-middle-left of the screen (might be useful for some apps)

adb shell input tap 125 1725

To simulate a tap on the lower-middle-right of the screen (might be useful for some apps)

adb shell input tap 375 1725

To simulate a long press in the upper-middle-left of the screen

adb shell input swipe 125 575 125 575 2000

To simulate a long press in the upper-middle-right of the screen

adb shell input swipe 375 575 375 575 2000

To simulate a long press in the lower-middle-left of the screen

adb shell input swipe 125 1725 125 1725 2000

To simulate a long press in the lower-middle-right of the screen

adb shell input swipe 375 1725 375 1725 2000

To simulate a diagonal swipe from upper-middle-left to lower-middle-right of the screen

adb shell input swipe 125 575 375 1725

To simulate a diagonal swipe from upper-middle-right to lower-middle-left of the screen

adb shell input swipe 375 575 125 1725

To simulate a diagonal swipe from lower-middle-left to upper-middle-right of the screen

adb shell input swipe 125 1725 375 575

To simulate a diagonal swipe from lower-middle-right to upper-middle-left of the screen

adb shell input swipe 375 1725 125 575

To simulate a tap on the center of the status bar (useful for some quick settings)

adb shell input tap 250 50

To simulate a tap on the center of the antenna area (might be useful for some games or full-screen apps)

adb shell input tap 250 2250

To simulate a swipe from the center of the antenna area to the center of the screen (useful for some games or full-screen apps)

adb shell input swipe 250 2250 250 1150

To simulate a swipe from the center of the status bar to the center of the screen (useful for pulling down the notification shade)

adb shell input swipe 250 50 250 1150

To simulate a "zig-zag" swipe from the top-left to the bottom-right of the screen

adb shell input swipe 0 0 500 1150 & adb shell input swipe 500 1150 0 2300

To simulate a "zig-zag" swipe from the top-right to the bottom-left of the screen

adb shell input swipe 500 0 0 1150 & adb shell input swipe 0 1150 500 2300

To simulate a pinch gesture at the top of the screen

adb shell input swipe 125 300 250 600 & adb shell input swipe 375 300 250 600

To simulate a spread gesture at the top of the screen

adb shell input swipe 250 600 125 300 & adb shell input swipe 250 600 375 300

To simulate a pinch gesture at the bottom of the screen

adb shell input swipe 125 2000 250 1700 & adb shell input swipe 375 2000 250 1700

To simulate a spread gesture at the bottom of the screen

adb shell input swipe 250 1700 125 2000 & adb shell input swipe 250 1700 375 2000

To simulate a complex gesture (like drawing an "X" from corner to corner)

adb shell input swipe 0 0 500 2300 & adb shell input swipe 500 0 0 2300

To simulate a long press in the middle and then a swipe to the right (useful for triggering slide menus)

adb shell input swipe 250 1150 400 1150 2000

To simulate a long press in the middle and then a swipe to the left (useful for triggering slide menus)

adb shell input swipe 250 1150 100 1150 2000

To simulate a swipe from the center of the screen to the "Back" button (might be useful for some full-screen apps)

adb shell input swipe 250 1150 50 2250

To simulate a swipe from the center of the screen to the "Home" button (might be useful for some full-screen apps)

adb shell input swipe 250 1150 250 2250

To simulate a swipe from the center of the screen to the "Recent Apps" button (might be useful for some full-screen apps)

adb shell input swipe 250 1150 450 2250

To simulate a long press on the top-middle of the screen (might be useful for some apps)

adb shell input swipe 250 300 250 300 2000

To simulate a long press on the bottom-middle of the screen (might be useful for some apps)

adb shell input swipe 250 2000 250 2000 2000

To simulate a pinch gesture in the left-half of the screen

adb shell input swipe 0 1150 125 1150 & adb shell input swipe 250 1150 125 1150

To simulate a spread gesture in the left-half of the screen

adb shell input swipe 125 1150 0 1150 & adb shell input swipe 125 1150 250 1150

To simulate a pinch gesture in the right-half of the screen

adb shell input swipe 500 1150 375 1150 & adb shell input swipe 250 1150 375 1150

To simulate a spread gesture in the right-half of the screen

adb shell input swipe 375 1150 500 1150 & adb shell input swipe 375 1150 250 1150

To simulate a swipe in the shape of a square (might be useful for some games or apps)

adb shell input swipe 125 875 375 875 & adb shell input swipe 375 875 375 1425 & adb shell input swipe 375 1425 125 1425 & adb shell input swipe 125 1425 125 875

To simulate a tap on the center of the screen with a delay (useful for timed inputs)

adb shell input tap 250 1150; sleep 1

To simulate multiple taps on the center of the screen with a delay between each (useful for timed inputs)

adb shell input tap 250 1150; sleep 1; adb shell input tap 250 1150; sleep 1; adb shell input tap 250 1150

To simulate a swipe from the middle to the left of the screen (useful for some slide menus)

adb shell input swipe 250 1150 0 1150

To simulate a swipe from the middle to the right of the screen (useful for some slide menus)

adb shell input swipe 250 1150 500 1150

To simulate a swipe from the left to the middle of the screen (useful for some slide menus)

adb shell input swipe 0 1150 250 1150

To simulate a swipe from the right to the middle of the screen (useful for some slide menus)

adb shell input swipe 500 1150 250 1150

To simulate a swipe from the "Back" button to the "Home" button (useful for some full-screen apps)

adb shell input swipe 50 2250 250 2250

To simulate a swipe from the "Home" button to the "Recent Apps" button (useful for some full-screen apps)

adb shell input swipe 250 2250 450 2250

To simulate a swipe from the "Recent Apps" button to the "Home" button (useful for some full-screen apps)

adb shell input swipe 450 2250 250 2250

To simulate a swipe from the "Home" button to the "Back" button (useful for some full-screen apps)

adb shell input swipe 250 2250 50 2250

To simulate a long press on the "Recent Apps" button (useful for some services)

bash adb shell input swipe 450 2250 450 2250 2000bash