1

我尝试构建 jar 以使用来自 Android 的 uiautomator。

我创建了一个非常简单的测试,如下所示:

public class TestUIAutomator extends UiAutomatorTestCase  {

public TestUIAutomator(String name) throws UiObjectNotFoundException {
    // Simulate a short press on the HOME button.
    getUiDevice().pressHome();
    //super(name);
}

protected void setUp() throws Exception {
    super.setUp();
}

}

然后我使用 ant 使用以下命令创建 uitest 项目:

android create uitest-project -n HelloWorldTestUIAutomator -t 11 -p D:\tec_met_android\HelloWorldTestUIAutomator

然后我从 Eclipse 运行 build.xml 并在控制台中收到以下消息:

 Buildfile: D:\tec_met_android\HelloWorldTestUIAutomator\build.xml
 [echo] Out file : D:\tec_met_android\HelloWorldTestUIAutomator\bin/HelloWorldTestUIAutomator.jar
 [echo] Android Ant Build. Available targets:
 [echo]    help:      Displays this help.
 [echo]    clean:     Removes output files created by other targets.
 [echo]    build:     Builds the test library.
 [echo]    install:   Installs the library on a connected device or
 [echo]               emulator.
 [echo]    test:      Runs the tests.
 [echo] It is possible to mix targets. For instance:
 [echo]    ant build install test
 [echo] This will build, install and run the test in a single command.
 BUILD SUCCESSFUL
 Total time: 414 milliseconds

它显示成功。但是输出目录中没有 JAR。

谢谢帮助..!

4

0 回答 0