I use "adb shell input tap 'x' 'y'" command to tap on a specified location on a touch screen android device. But the device I am working on is a TV(based on android) which can only be used using remote. I am able to enable the pointer location using "adb shell settings put system pointer_location 1" and using bluetooth keyboard connected to the TV found the exact 'x' and 'y' location of the button where i want to tap. But "adb shell input tap" command didn't work as it worked in touch screen device, guess its due to a non-touch screen device. Is there any workaround to tap the intended button on a non-touch screen (TV) device?
Asked
Active
Viewed 5,402 times
0
-
What does this have to do with amazon-fire-tv or fireos? You didn't mention it in your actual question. – hellow Apr 18 '18 at 07:52
-
Use Monkey runner https://stackoverflow.com/a/11796266/5710872 – Qamar Apr 18 '18 at 09:31
-
@Qamar can i get the download link to download the Monkey runner software for my windows 8 PC? – Josh Apr 25 '18 at 04:56
1 Answers
1
IIRC shell input tap x y
should work even for the amazon firtev.
But in any case you can just emulate the DPAD actions of the firetv remote with
adb shell input keyevent <keyeventcode>
The keyevent codes for the DPAD are
19 --> "KEYCODE_DPAD_UP"
20 --> "KEYCODE_DPAD_DOWN"
21 --> "KEYCODE_DPAD_LEFT"
22 --> "KEYCODE_DPAD_RIGHT"
23 --> "KEYCODE_DPAD_CENTER"
To emulate the Home and back buttons on the remote use
3 --> "KEYCODE_HOME"
4 --> "KEYCODE_BACK"

Srini
- 1,619
- 1
- 19
- 34