安卓控件获取器uiautomatorviewer初体验:"unable to connect to the adb. check if adb is installed correctly&

Posted 当年亦如是

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安卓控件获取器uiautomatorviewer初体验:"unable to connect to the adb. check if adb is installed correctly&相关的知识,希望对你有一定的参考价值。

解决方法:转自:https://plus.google.com/108487870030743970488/posts/2TrMqs1ZGQv

Challenge Accepted:
1. ScreenshotAction class has this in its run() method when !DebugBridge.isInitialized()

2. DebugBridge is not initialized when it can‘t find the "platform-tools" folder which it gets via the property ""com.android.uiautomator.bindir"

3. The above property is set (in windows) in uiautomatorviewer.bat:
call %java_exe% Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir= -jar %jarpath% %

4. Strange that it is empty isn‘t it. Changing the above line in my case to:
call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir=H:\android-sdk\tools -jar %jarpath% %

This solves the issue, and UI Automator Viewer is up. The app is pretty neat with all the "mouse over""find view" feature.

 

翻译:

修改uiautomatorviewer.bat文件标红部分

call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" "-Dcom.android.uiautomator.bindir=C:\Users\z_wh\AppData\Local\Android\sdk\tools" -jar %jarpath% %*


以上是关于安卓控件获取器uiautomatorviewer初体验:"unable to connect to the adb. check if adb is installed correctly&的主要内容,如果未能解决你的问题,请参考以下文章

uiautomatorviewer获取控件元素增强版

monkeyrunner之坐标或控件ID获取方法-续

Appium移动自动化测试——app控件获取之uiautomatorviewer

app控件唯一相对Xpath自动生成(增强版uiautomatorviewer)

Android版App的控件元素定位

Appium知识积累