创建java工程:Demo1
包名:com.bing.cn
类名:Test
测试用例:testDemo
android create uitest-project -n Demo1 -t 7 -p E:eclipseDemo1
E:eclipseDemo1>ant build
Eclipse使用Ant编译提示Class not found: javac1.8
E:eclipseDemo1>adb push E:eclipseDemo1inDemo1.jar data/local/tmp
E:eclipseDemo1>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);