gpt4 book ai didi

android - 无法找到 : ComponentInfo{. 的检测信息 ./android.support.test.runner.AndroidJUnitRunner}

转载 作者:行者123 更新时间:2023-11-29 01:04:15 25 4
gpt4 key购买 nike

我已经编写了一个简单的 Android 工具测试用例来测试网络操作。

Test case class name: Main3ActivityTest.java
Method name:addNewEmployee

我使用命令行运行测试用例,然后出现以下异常。

Command:
./adb -s emulator-5554 shell am instrument -w -r -e class murali.myapplication.Main3ActivityTest#addNewEmployee murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner

Issue:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner}
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: murali.myapplication.test/android.support.test.runner.AndroidJUnitRunner
at com.android.commands.am.Am.runInstrument(Am.java:1093)
at com.android.commands.am.Am.onRun(Am.java:371)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:100)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

我的测试用例 (murali.myapplication.Main3ActivityTest) 在检测列表中找不到:

$ ./adb -s emulator-5554 shell pm list instrumentation
instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)

我添加了testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

请帮我找出问题所在?

最佳答案

看起来你还没有安装应用程序-使用以下方式安装应用程序:

$adb shell pm install -r <directory/apk_name> 

然后您将能够看到您的仪器正在运行:

$adb shell pm list instrumentation

关于android - 无法找到 : ComponentInfo{. 的检测信息 ./android.support.test.runner.AndroidJUnitRunner},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48563473/

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