您可以在一个python脚本试试这个:
from subprocess import call
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
# These show the package name of the currently running package and
# the current activity's action.
device.getProperty('am.current.package')
device.getProperty('am.current.action')
随着monkeyrunner您也可以点击按钮/按使用(X,Y)坐标。
另一种方法是查看logcat输出中的活动更改。它应该看起来像这样:显示com.android.gallery3d/.app.MovieActivity为什么要从库中播放视频文件。
后来编辑:
您可以使用“am.current.package”和“am.current.action”看到活动的变化。您可以使用:
call('adb getevent', shell = True)
捕捉点击/触摸事件。全部在相同的脚本中。