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

相关文章

适配器模式将一个类的接口转换成客户期望的另一个接口,使得原本接口不兼容的类可以相互合作。
策略模式定义了一系列算法族,并封装在类中,它们之间可以互相替换,此模式让算法的变化独立于使用算法...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,它是针对软件开发中经常遇到的一些设计问题...
模板方法模式在一个方法中定义一个算法的骨架,而将一些步骤延迟到子类中,使得子类可以在不改变算法结...
迭代器模式提供了一种方法,用于遍历集合对象中的元素,而又不暴露其内部的细节。
外观模式又叫门面模式,它提供了一个统一的(高层)接口,用来访问子系统中的一群接口,使得子系统更容...