由于之前没做过UI自动化,近期准备做H5自动化,要学的东西还是很多。

1、本地debug环境:android studio + android SDK(想要调试通要关注:驱动、手机开发者模式要打开)

2、手机应用的元素id查看:直接用android sdk的 %android_home%\tools\bin\uiautomatorviewer.bat

3、应用包名+启动页查看:包名相对容易,可在2提到的工具查到;启动页就比较麻烦,可用命令:使用命令adb logcat ActivityManager:I *:s

https://blog.csdn.net/wjw_java_android/article/details/52299353

https://www.cnblogs.com/fnng/p/7350900.html

4、adb 打开网页:

adb shell am start -a android.intent.action.VIEW -d  http://www.baidu.com

5、adb 滑动屏幕

adb shell input swipe 540 1300 540 500 100   从坐标点(540,1300)用100ms滑动到(540,500)坐标点

posted on 2018-06-04 17:48  蛋尼  阅读(136)  评论(0编辑  收藏  举报