我正在尝试使用 Monkey Runner 中的层次结构查看器来查看我的 Android 应用程序的布局。当我调用device.getHierarchyViewer()
方法时,我遇到了以下问题。
E/hierarchyviewer: String index out of range: 1155
130924 11:36:18.917:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions
] Script terminated due to an exception
130924 11:36:18.917:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions
]Traceback (most recent call last):
File "F:\python\testing.py", line 311, in <module>
pressButton ('id/action_bar_home_btn_area')
File "F:\python\testing.py", line 86, in pressButton
easy_device.touch(By.id(buttonID), MonkeyDevice.DOWN_AND_UP)
File "F:\python\testing.py", line 86, in pressButton
easy_device.touch(By.id(buttonID), MonkeyDevice.DOWN_AND_UP)
at com.android.chimpchat.hierarchyviewer.HierarchyViewer.findViewById(Hi
erarchyViewer.java:75)
at com.android.monkeyrunner.easy.By.findView(By.java:72)
at com.android.monkeyrunner.easy.EasyMonkeyDevice.getElementCenter(EasyM
onkeyDevice.java:219)
at com.android.monkeyrunner.easy.EasyMonkeyDevice.touch(EasyMonkeyDevice
.java:85)
at com.android.monkeyrunner.easy.EasyMonkeyDevice.touch(EasyMonkeyDevice
.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.RuntimeException: java.lang.RuntimeException: Could not dump view
对此的任何帮助表示赞赏。