Is it possible for adb shell
console to access an Android app\'s specific button using its id? or text?
I\'m trying to automate the button click on the dev
You won't be able to use the button id, but you can get the button coordinates and simulate a tap event.
Android comes with an input command-line tool that can simulate miscellaneous input events. To simulate tapping, use:
input tap x y
You can use the adb shell to run the command remotely:
adb shell input tap x y
Other options are:
shell@m0:/ $ input
input
usage: input ...
input text
input keyevent
input [touchscreen|touchpad|touchnavigation] tap
input [touchscreen|touchpad|touchnavigation] swipe [duration(ms)]
input trackball press
input trackball roll