我正在使用 Eclipse IDE。这是我的 uiautomator 测试用例代码:
public class caltest extends UiAutomatorTestCase {
public void testDemo() throws UiObjectNotFoundException, IOException {
//mytesstcode
}
}
要运行此测试,我必须从命令行发出以下命令:
/tools/android 创建 uitest-project -n -t 1 -p
转到 build.xml 文件所在的项目目录并构建测试 JAR。---> 蚂蚁构建
使用 adb push 命令将生成的测试 JAR 文件部署到测试设备:---> adb push /data/local/tmp/
---> adb shell uiautomator runtest jarname.jar -c caltest
有什么方法可以在不使用命令行的情况下运行我的测试,即从 eclipse ide 或从 android 应用程序中。