一、weditor定位
可以通过手机IP地址和USB的方式链接到手机
1、安装weditor
pip install --pre --upgrade weditor -i http://mirror-sng.oa.com/pypi/web/simple/ --trusted-host mirror-sng.oa.com
2、使用weditor
python -m weditor
执行命令,会打开一个网页 ATX WEditor.
3、链接手机
网页最上方填写手机序列号(adb devices获得)或者手机IP地址
(电脑能够ping通手机的IP地址),点击connect出现绿色小树就成功了。
#获得序列号
>adb devices
List of devices attached
8XV7N16310003265 device
#有网下获得IP
>adb shell netcfg
/system/bin/sh: netcfg: not found
>adb shell ifconfig rmnet0
ifconfig: rmnet0: No such device
#有网无网下获得IP
>adb shell ifconfig | findstr Mask
inet addr:127.0.0.1 Mask:255.0.0.0
4、点击Dump Hierarchy,刷新手机页面,左侧显示屏幕,右侧显示代码,中间显示所选元素信息
二、AndroidSDK中的uiautomatorviewer定位