我想用猴子测试工具测试我的应用程序,但它只能达到 700 个事件,然后它会因一些模糊的日志消息而崩溃:
07-18 13:56:44.600: E/AndroidRuntime(27622): FATAL EXCEPTION: main
07-18 13:56:44.600: E/AndroidRuntime(27622): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131165444, class org.holoeverywhere.widget.ListView) with Adapter(class org.holoeverywhere.widget.HeaderViewListAdapter)]
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.widget.ListView.layoutChildren(ListView.java:1544)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.widget.AbsListView.onTouchModeChanged(AbsListView.java:3213)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewTreeObserver.dispatchOnTouchModeChanged(ViewTreeObserver.java:712)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.ensureTouchModeLocally(ViewRootImpl.java:3074)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.ensureTouchMode(ViewRootImpl.java:3058)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3202)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4344)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.Choreographer.doFrame(Choreographer.java:530)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.os.Handler.handleCallback(Handler.java:725)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.os.Handler.dispatchMessage(Handler.java:92)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.os.Looper.loop(Looper.java:137)
07-18 13:56:44.600: E/AndroidRuntime(27622): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-18 13:56:44.600: E/AndroidRuntime(27622): at java.lang.reflect.Method.invokeNative(Native Method)
07-18 13:56:44.600: E/AndroidRuntime(27622): at java.lang.reflect.Method.invoke(Method.java:511)
07-18 13:56:44.600: E/AndroidRuntime(27622): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-18 13:56:44.600: E/AndroidRuntime(27622): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-18 13:56:44.600: E/AndroidRuntime(27622): at dalvik.system.NativeStart.main(Native Method)
这就是我启动猴子工具的方式:
adb shell monkey -p app.package -v 300000
任何想法如何克服这个错误?