Android studio 获取ExampleInstrumentedTest的java.lang.ClassNotFoundException错误
背景: 我试图触发一个基于检测的monkey测试。但是当我运行并将apk推送到一个设备上,然后运行下面的命令时:Android studio 获取ExampleInstrumentedTest的java.lang.ClassNotFoundException错误,android-studio,ui-automation,android-uiautomator,android-instrumentation,Android Studio,Ui Automation,Android Uiautomator,Android Instrumentation,背景: 我试图触发一个基于检测的monkey测试。但是当我运行并将apk推送到一个设备上,然后运行下面的命令时: adb shell am instrument -w -r -e runtime 1 -e debug false -e class com.kb.kbmonkey.ExampleInstrumentedTest com.kb.kbmonkey/androidx.test.runner.AndroidJUnitRunner 我得到的错误如下: 原因:java.lang.ClassN
adb shell am instrument -w -r -e runtime 1 -e debug false -e class com.kb.kbmonkey.ExampleInstrumentedTest com.kb.kbmonkey/androidx.test.runner.AndroidJUnitRunner
我得到的错误如下:
原因:java.lang.ClassNotFoundException:在路径上未找到类“com.kb.kbmonkey.ExampleInstrumentedTest”
所以我的问题是:androidTest和test文件夹下的java文件是否未在apk中导出 谢谢你应该跑了
./gradlew installDebugAndroidTest
安装测试仪器
然后,您的命令就可以工作了