Is there a way to use adb to tap on a secondary Android display

49 Views Asked by At

I know there are ways to target a secondary screen like this:

adb shell am start com.google.android.calculator --display 1

adb shell screencap -d 1 -p /sdcard/screencapture.png

Is there a way to tap on a a secondary screen? For now this seem to only go to display 0:

adb shell input tap x y

1

There are 1 best solutions below

0
Nightrain On

It seems like this does it. The issue I have with it not working was that the screen coordinates in the dump XML were taking into account the X axis from the display 0, but the ADB do not do that, so they needed to be subtracted.

adb shell input -d 1 tap x y