我正在开发一个从 adb 控制台进行定时控制的应用程序。'adb shell sendevent' 命令控制应用程序的触摸事件。但是这个触摸事件是定时的,并且命令
import os
apkLocation = "/Users/siddharthan64/Desktop/adt/sdk/platform-tools/"
os.chdir(apkLocation)
cmdList = ['./adb shell sendevent /dev/input/event2: 3 53 251','./adb shell sendevent / dev/input/event2: 3 54 399','./adb shell sendevent /dev/input/event2: 3 48 10','./adb shell sendevent /dev/input/event2: 3 50 7','./adb shell sendevent /dev/input/event2: 0 2 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 50 7']
cmdList.append[,'./adb shell sendevent /dev/input/event2: 0 2 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 0 0 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 57 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 53 251']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 54 399']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 48 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 3 50 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 0 2 0']
cmdList.append['./adb shell sendevent /dev/input/event2: 0 0 0']
for tcmd in cmdList:
p = os.popen(tcmd,"r")
当应用程序上发生特定事件时发送。