无法运行AndroidViewClient

时间:2014-05-09 11:57:59

标签: androidviewclient

我在不使用Source的情况下获取当前屏幕的所有ID。

https://stackoverflow.com/questions/23333936/android-get-id-of-the-each-widget-in-the-screen-without-source

所以我使用的是Androidviewclient

遵循以下步骤

1)下载了Androidviewclient-master.zip

2)解压缩并编辑AndroidViewClient-master \ AndroidViewClient \ tools中的转储文件以获取源位置

3)设置环境变量ANDROID_VIEW_CLIENT_HOME和PYTHONPATH

4)当我在cmd

中执行如下操作时

C:\ Users \ Lahir \ Desktop \ Automation \ adt-bundle-windows-x86_64-20131030 \ adt-bundle-windows-x86_64-20131030 \ sdk \ tools> monkeyrunner.bat C:\ AndroidViewClient-master \ AndroidViewClient \工具\ dump.py

获取如下错误: -

无法打开指定的脚本文件 用法:monkeyrunner [options] SCRIPT_FILE -s MonkeyServer IP地址。 -p MonkeyServer TCP端口。 -v MonkeyServer日志记录级别(ALL,FINEST,FINER,FINE,CONFIG,INFO,WARNING,SEVERE,OFF)

如果我按以下方式运行转储

,也可以代替dump.py

C:\ Users \ Lahir \ Desktop \ Automation \ adt-bundle-windows-x86_64-20131030 \ adt-bundle-windows-x86_64-20131030 \ sdk \ tools> monkeyrunner.bat C:\ AndroidViewClient-master \ AndroidViewClient \工具\转储

我收到以下错误

140509 17:19:12.884:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]脚本因异常而终止 140509 17:19:12.884:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Traceback(最近一次调用最后一次):   文件" C:\ AndroidViewClient-master \ AndroidViewClient \ tools \ dump",第129行,in     vc = ViewClient(* ViewClient.connectToDeviceOrExit(** kwargs1),** kwargs2)   文件" C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py",第1435行,在connectToDeviceOrExit中     ViewClient.setAlarm(超时+ 5)   文件" C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py",第1395行,在setAlarm中     signal.alarm(超时)   文件" C:\ Users \ Lahir \ Desktop \ Automation \ adt-bundle-windows-x86_64-20131030 \ adt-bundle-windows-x86_64-20131030 \ sdk \ tools \ lib \ jython-standalone-2.5.3。 jar \ Lib \ signal.py",第222行,处于警报

NotImplementedError:此平台未实现警报

140509 17:19:12.884:org.python.core.PyException.doRaise(PyException.java:219)中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] 140509 17:19:12.884:org.python.core.Py.makeException(Py.java:1239)中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] 140509 17:19:12.884:org.python.core.Py.makeException(Py.java:1243)中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] 140509 17:19:12.884:org.python.core.Py.makeException(Py.java:1247)中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] 140509 17:19:12.884:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]信号$ py.alarm $ 14(C:\ Users \ Lahir \ Desktop \ Automation \ adt-bundle-windows-x86_64-20131030 \ adt -bundle - 窗口x86_64-20131030 \ SDK \工具\ LIB \ Jython的独立-2.5.3.jar \库\ S 140509 17:19:12.884:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]信号$ py.call_function(C:\ Users \ Lahir \ Desktop \ Automation \ adt-bundle-windows-x86_64-20131030 \ adt-捆绑窗口-x86_64-20131030 \ SDK \工具\ LIB \ Jython的独立-2.5.3.jar \ 140509 17:19:12.884:org.python.core.PyTableCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyTableCode.java:165) 140509 17:19:12.884:org.python.core.PyBaseCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyBaseCode.java:134) 140509 17:19:12.884:在org.python.core.PyFunction上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]。调用(PyFunction.java:317) 140509 17:19:12.884:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]在com.dtmilano.android.viewclient $ py.setAlarm $ 71(C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py:1395) 140509 17:19:12.884:com.dtmilano.android.viewclient $ py.call_function中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py) 140509 17:19:12.884:org.python.core.PyTableCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyTableCode.java:165) 140509 17:19:12.884:org.python.core.PyBaseCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyBaseCode.java:134) 140509 17:19:12.884:在org.python.core.PyFunction上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]。调用(PyFunction.java:317) 140509 17:19:12.884:在com.dtmilano.android.viewclient上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] $ py.connectToDeviceOrExit $ 72(C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py:1463) 140509 17:19:12.884:com.dtmilano.android.viewclient $ py.call_function中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](C:\ AndroidViewClient-master \ AndroidViewClient \ src \ com \ dtmilano \ android \ viewclient.py) 140509 17:19:12.884:org.python.core.PyTableCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyTableCode.java:165) 140509 17:19:12.884:org.python.core.PyBaseCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyBaseCode.java:301) 140509 17:19:12.884:在org.python.core.PyFunction.function ___上调用_ [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] __(PyFunction.java:376) 140509 17:19:12.884:org.python.core.PyFunction中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]。调用(PyFunction.java:371) 140509 17:19:12.884:在org.python.core.PyFunction上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]。调用(PyFunction.java:366) 140509 17:19:12.884:org.python.core.PyObject._callextra中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyObject.java:527) 140509 17:19:12.884:在org.python.pycode._pyx0.f $ 0上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](C:\ AndroidViewClient-master \ AndroidViewClient \ tools \ dump:131) 140509 17:19:12.884:在org.python.pycode._pyx0.call_function(C:\ AndroidViewClient-master \ AndroidViewClient \ tools \ dump)中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] 140509 17:19:12.884:org.python.core.PyTableCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyTableCode.java:165) 140509 17:19:12.884:org.python.core.PyCode.call中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PyCode.java:18) 140509 17:19:12.884:org.python.core.Py.runCode中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](Py.java:1275) 140509 17:19:12.884:org.python.core上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]。 builtin .execfile_flags( builtin .java:522 ) 140509 17:19:12.884:org.python.util.PythonInterpreter.execfile中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](PythonInterpreter.java:225) 140509 17:19:12.884:com.android.monkeyrunner.ScriptRunner.run中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](ScriptRunner.java:116) 140509 17:19:12.884:com.android.monkeyrunner.MonkeyRunnerStarter.run中的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions](MonkeyRunnerStarter.java:77) 140509 17:19:12.884:在com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:189)上的[MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]

不知道怎么弄它?需要帮助请指导我。

1 个答案:

答案 0 :(得分:0)

我假设您从github下载了最新版本(.i.e。 AndroidViewClient 5.4.7 )。 在这种情况下,您不需要monkeyrunner,只需python

我认为

python C:\AndroidViewClient-master\AndroidViewClient\tools\dump.py

应该有用(对不起,我猜测我不会使用Windows)。

您还可以尝试easy_install尝试自动保持 AndroidViewClient 最新。 查看How to use Python's "easy_install" on Windows ... it's not so easy以获取一些提示。