uiautomator 试用心得

这是官方地址:https://developer.android.com/tools/testing/testing_ui.html
觉得有这两点缺陷 :
1) 因为需要打jar包然后push到机器上,调试很不方便
2)API level 16以上(4.1以上) 所以机型就有限制,老用模拟器也不实际

需要用到如下命令:
到sdk tool目录(需根据你实际目录情况修改项目名和路径),执行android create uitest-project -n Hello -t 9 -p ../../truck/Hello/

ant build


需进入到项目目录
adb push Hello.jar /data/local/tmp/
adb shell uiautomator runtest Hello.jar -c com.test.HelloWorld

猜你喜欢

转载自xiarihexiang.iteye.com/blog/1754446