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
if me, i use python to do that, combine cmd command with subprocess.Popen, the script would be:
from subprocess import Popen, PIPE
import os
adbpath = r'YOUR ADB DIR'
adbfile = 'adb.exe'
adb = os.path.join(adbpath, adbfile)
def tap(a):
cor = a
t = Popen([adb, 'shell', 'input', 'tap', str(a[0]), str(a[1])])
#i give you extra script
def swipe(a, b):
first = a
last = b
sab = Popen([adb, 'shell', 'input', 'swipe', str(first[0]), str(first[1]), str(last[0]), str(last[1]), '200'])
then when you have a button coord to tap just do this:
ok_coord = 122,137
tap(ok_coord)
when you want to swipe:
coord1 = 122,373
coord2 = 122,26
swipe(coord1, coord2)
to get the coordinate of button or a point, use 'uiautomatorviewer.bat' that exists in folder 'sdk\tools\bin'
or you can use apricot, erm3nda or Vinicius Dantas method,