Uiautomator依赖jar包找不到的提示

纯粹做个笔记


root@hammerhead:/data/local/tmp #uiautomator runtest /data/local/tmp/appsimulation.jar -c com.dkxy.appsimulation.AppSimulationTestCase#main
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.dkxy.appsimulation.AppSimulationTestCase:
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=main
INSTRUMENTATION_STATUS: class=com.dkxy.appsimulation.AppSimulationTestCase
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
Error in main:
java.lang.NoClassDefFoundError: com.dkxy.appsimulationcommon.BaseSimulation
        at com.dkxy.appsimulation.AppSimulationTestCase.main(AppSimulationTestCase.java:22)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
        at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
        at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
        at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
        at dalvik.system.NativeStart.main(Native Method)

INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=main
INSTRUMENTATION_STATUS: class=com.dkxy.appsimulation.AppSimulationTestCase
INSTRUMENTATION_STATUS: stack=java.lang.NoClassDefFoundError: com.dkxy.appsimulationcommon.BaseSimulation
        at com.dkxy.appsimulation.AppSimulationTestCase.main(AppSimulationTestCase.java:22)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
        at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
        at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
        at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
        at dalvik.system.NativeStart.main(Native Method)

INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS: stream=
Test results for WatcherResultPrinter=.E
Time: 0.053

FAILURES!!!
Tests run: 1,Failures: 0,Errors: 1


INSTRUMENTATION_STATUS_CODE: -1

比较奇葩的是,通过adb shell执行的命令没有任何的提示

C:\Users\win10>adb shell "uiautomator runtest /data/local/tmp/appsimulation.jar -c com.dkxy.appsimulation.AppSimulationTestCase"
INSTRUMENTATION_STATUS: stream=
Test results for WatcherResultPrinter=
Time: 0.007

OK (0 tests)


INSTRUMENTATION_STATUS_CODE: -1



实际有效命令:

uiautomator runtest /data/local/tmp/appsimulation.jar /data/local/tmp/appsimulationcommon.jar -c com.dkxy.appsimulation.AppSimulationTestCase#main

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...