-1

ADB input events work for automated testings. For example,

adb shell input tap X Y

fires a tap event in X Y position of the screen. Now, my intention is to fire an tap event after a user tap happens in the screen. For example,

adb shell input tap X1 Y1

[user selects an item from the list] and next event waits until user selection

adb shell input tap X2 Y2

Is there any way around to do that?

Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256
  • Assuming you are testing your own app, you could add special logcat messages to output unique strings when the user selects something. On PC side monitor logcat and at certain positions wait for that specific output. – Robert Nov 14 '22 at 14:03

1 Answers1

1

Loop trought

getevent -l

output and when you get the event you want, for example

/dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   00000041
/dev/input/event3: EV_ABS       ABS_MT_PRESSURE      0000000c
/dev/input/event3: EV_ABS       ABS_MT_POSITION_X    00000152
/dev/input/event3: EV_ABS       ABS_MT_POSITION_Y    00000446
/dev/input/event3: EV_KEY       BTN_TOUCH            DOWN
/dev/input/event3: EV_SYN       SYN_REPORT           00000000
/dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   ffffffff
/dev/input/event3: EV_KEY       BTN_TOUCH            UP

a button touch, and if it's the one you are looking for then send the following taps.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134