gpt4 book ai didi

android - adb shell am 仪器进程崩溃

转载 作者:行者123 更新时间:2023-12-05 00:08:37 26 4
gpt4 key购买 nike

我正在尝试使用测试 apk 文件对第 3 方 apk 文件运行 Espresso 黑盒测试。我在 build.gradle 中设置了 testApplicationId,在 AndroidManifest.xml 中设置了 targetPackage。

这是我运行的命令:

adb install app-debug.apk
Success
adb install app-debug-androidTest.apk
Success
adb shell am instrument -w com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

这是 tomcat 日志:

09-11 22:22:17.065  8576  8576 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
09-11 22:22:17.098 8576 8576 W app_process: Unexpected CPU variant for X86 using defaults: x86
09-11 22:22:17.116 8576 8576 D AndroidRuntime: Calling main entry com.android.commands.am.Am
09-11 22:22:17.118 1510 2317 I ActivityManager: Force stopping org.wikipedia.alpha appid=10102 user=0: start instr
09-11 22:22:17.123 8586 8586 I zygote : Not late-enabling -Xcheck:jni (already on)
09-11 22:22:17.130 1510 2317 I ActivityManager: Start proc 8586:org.wikipedia.alpha/u0a102 for added application org.wikipedia.alpha
09-11 22:22:17.131 8586 8586 W zygote : Unexpected CPU variant for X86 using defaults: x86
09-11 22:22:17.149 8586 8586 W zygote : Found duplicate classes, falling back to extracting from APK : /data/app/org.wikipedia.alpha-X9wevNAQOGt3rTh-c4Ydpg==/base.apk
09-11 22:22:17.149 8586 8586 W zygote : NOTE: This wastes RAM and hurts startup performance.
09-11 22:22:17.149 8586 8586 W zygote : Found duplicated class when checking oat files: 'Landroid/support/annotation/AnimRes;' in /data/app/org.wikipedia.alpha-X9wevNAQOGt3rTh-c4Ydpg==/base.apk and /data/app/com.example.android.testing.espresso.WikipediaTester-iiYiial_oKwqZvmMrjx_Zw==/base.apk
09-11 22:22:17.149 8586 8586 W zygote :
09-11 22:22:17.279 8586 8586 W System : ClassLoader referenced unknown path:
09-11 22:22:17.281 8586 8586 D AndroidRuntime: Shutting down VM
09-11 22:22:17.282 8586 8586 E AndroidRuntime: FATAL EXCEPTION: main
09-11 22:22:17.282 8586 8586 E AndroidRuntime: Process: org.wikipedia.alpha, PID: 8586
09-11 22:22:17.282 8586 8586 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner}: java.lang.ClassNotFoundException: Didn't find class "android.support.test.runner.AndroidJUnitRunner" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib, /system/vendor/lib]]
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5730)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6541)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.test.runner.AndroidJUnitRunner" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib, /system/vendor/lib]]
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5728)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: ... 8 more
09-11 22:22:17.284 8586 8586 I Process : Sending signal. PID: 8586 SIG: 9
09-11 22:22:17.328 1510 1522 I ActivityManager: Process org.wikipedia.alpha (pid 8586) has died: fore FGS
09-11 22:22:17.329 1510 1522 W ActivityManager: Crash of app org.wikipedia.alpha running instrumentation ComponentInfo{com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner}
09-11 22:22:17.329 1510 1522 I ActivityManager: Force stopping org.wikipedia.alpha appid=10102 user=0: finished inst
09-11 22:22:17.330 1510 8604 W Binder : Outgoing transactions from this process must be FLAG_ONEWAY
09-11 22:22:17.330 1510 8604 W Binder : java.lang.Throwable
09-11 22:22:17.330 1510 8604 W Binder : at android.os.BinderProxy.transact(Binder.java:736)
09-11 22:22:17.330 1510 8604 W Binder : at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:160)
09-11 22:22:17.330 1510 8604 W Binder : at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
09-11 22:22:17.331 8576 8576 D AndroidRuntime: Shutting down VM

最佳答案

想通了,从androidTest移到main

关于android - adb shell am 仪器进程崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46168533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com