我终于成功地构建了一个安装了谷歌移动服务的Nexus10镜像(full_manta-userdebug),但不幸的是,我无法使用使用AndroidViewClient的MonkeyRunner脚本。它会在脚本中崩溃,并显示以下内容:
/system/bin/sh: uiautomator: not found
130628 14:12:41.242:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
130628 14:12:41.242:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call last):
File "/home/allen/projects/cts-scripts/4.2/cts-setup.py", line 361, in <module>
main()
File "/home/allen/projects/cts-scripts/4.2/cts-setup.py", line 339, in main
vc = ViewClient(device, serialno)
File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1188, in __init__
self.dump()
File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1780, in dump
self.setViewsFromUiAutomatorDump(received)
File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1530, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 1688, in _ViewClient__parseTreeFromUiAutomatorDump
self.root = parser.Parse(receivedXml)
File "/home/allen/projects/AndroidViewClient/AndroidViewClient/src/com/dtmilano/android/viewclient.py", line 988, in Parse
parserStatus = parser.Parse(uiautomatorxml, 1)
File "/home/allen/android/android-sdks/tools/lib/jython-standalone-2.5.4-rc1.jar/Lib/xml/parsers/expat.py", line 212, in Parse
xml.parsers.expat.ExpatError: Content is not allowed in prolog.我需要安装ViewServer才能正常工作吗?还是我在构建镜像时忘记了包括uiautomator后端?
发布于 2013-06-29 11:37:52
从命令行尝试uiautomator,看看它是否存在:
$ adb shell uiautomator如果您的输出类似于
Usage: uiautomator <subcommand> [options]
Available subcommands:
help: displays help message
...然后您已经安装了uiautomator。否则,如果输出为
/system/bin/sh: uiautomator: not found然后你忘了把它包含在图像中。
如果使用ViewServer作为AndroidViewClient后端,则不需要UiAutomator。
https://stackoverflow.com/questions/17373788
复制相似问题