创建java工程:Demo1
包名:com.bing.cn
类名:Test
测试用例:testDemo

android create uitest-project -n Demo1 -t 7 -p E:\eclipse\Demo1

E:\eclipse\Demo1>ant build
Eclipse使用Ant编译提示Class not found: javac1.8
E:\eclipse\Demo1>adb push E:\eclipse\Demo1\bin\Demo1.jar data/local/tmp
E:\eclipse\Demo1>adb shell uiautomator runtest Demo1.jar -c com.bing.cn.Test
快速调试:

public static void main(String[] args) {
new UiAutomatorHelper("Demo","cn.bing.com.Method","testMethod","7");
}

或者

String jarName="Demo1";
String testClass="com.bing.cn.Test";
String testName="testDevice";
String androidId="7";
new UiAutomatorHelper(jarName,testClass,testName,androidId);

05-11 21:45