求大神赐教,用monkeyrunner截图时老报错
D:\Program Files\Java\adt-bundle-windows-x86-20130917\sdk\tools>monkeyrunnerJython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35)
on java1.8.0_144
>>> from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
>>> devices=MonkeyRunner.waitForConnection(5,'4b37ca1d')
>>> devices.startActivity(component = 'com.jiaotong.app/.mvp.module.launch.Splas
hScreenActivity')
>>> devices.touch(351,1292,"DOWN_AND_UP")
>>> MonkeyRunner.sleep(5)
>>> result = device.takeSnapshot()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'device' is not defined
C:\Users\admin\Desktop\QQ截图20170920174330.png
报错 >>> from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
>>> devices=MonkeyRunner.waitForConnection(5,'4b37ca1d')
>>> devices.startActivity(component = 'com.jiaotong.app/.mvp.module.launch.Splas
hScreenActivity')
>>> devices.touch(351,1292,"DOWN_AND_UP")
>>> MonkeyRunner.sleep(5)
>>> result = device.takeSnapshot()
你在上面定义的是“devices” 然后截图时是“device”
这个错误提示的是你的“device”未定义 海海豚 发表于 2017-9-20 18:48
>>> from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
>>> devices=MonkeyRu ...
多谢 000 000
页:
[1]