app怎么定位
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了app怎么定位相关的知识,希望对你有一定的参考价值。
手机定位的好方法,你是不是才知道
参考技术A 可以通过以下方法解决问题:1、通过手机内部的GPS定位系统来进行定位。
使用uiautomatorviewer定位App元素
这个工具是Android SDK自带的,
日常的工作中经常要使用的,
在C:\\Android\\sdk\\tools\\bin目录下:
双击之,
请注意,
我一般选择第一个机器人小图标Device Screenshot,
而不是第二个Device Screenshot with Compressed Hierarchy,
因为第二个是具有压缩层次结构的设备截图,
有可能不准确;
首次启动会报错:
Unable to connect to adb. Check if adb is installed correctly.
怎么解决呢?
关闭之,
打开uiautomatorviewer.bat文件,
修改最后一行:
%prog_dir%
改为:
C:\\Android\\sdk\\platform-tools
并保存
再次打开uiautomatorviewer:
对应关系:
text find_element_by_android_uiautomator("new UiSelector().text(\\"文字\\")")
resource-id find_element_by_id
class find_element_by_class_name
content-desc find_element_by_accessibility_id
以上是关于app怎么定位的主要内容,如果未能解决你的问题,请参考以下文章