请教一个Eclipse调试Monkeyrunner的问题
系统环境:windows
前提:我已经在eclipse中配置了python和jython的环境,而且monkeyrunner也已经配置到了jython里头,我查了一下网上的环境配置,自己这边也是配置正确的。
代码:
#coding=utf-8
#!/usr/bin/python
'''
Created on 2016-3-16
@author: Administrator
'''
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice
import time
def testlogin():
device=MonkeyRunner.waitForConnection()
device.startActivity(component="com.quvideo.xiaoying/com.quvideo.xiaoying.app.SplashActivity")
time.sleep(3)
time.sleep(5)
def main():
testlogin()
if __name__=='__main__':
main()
就上述的代码,我是用Jython运行调试的,出现以下的问题:
Traceback (most recent call last):
File "F:\Eclipse\Test\monkeytest.py", line 27, in <module>
main()
File "F:\Eclipse\Test\monkeytest.py", line 24, in main
testlogin()
File "F:\Eclipse\Test\monkeytest.py", line 18, in testlogin
device=MonkeyRunner.waitForConnection()
at com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.NullPointerException: java.lang.NullPointerException
一直想不通是什么原因,麻烦有高手能够帮忙一下,谢谢~~~~~