当前位置: 首页 > article >正文

uiautomatorviewer中的两个错误

目录

1)Unable to connect to adb.Check if adb is installed correctly

解决办法修改配置文件

2)Unexpected error while obtaining UI hierachy

解决办法替换文件

 文件下载地址


1)Unable to connect to adb.Check if adb is installed correctly

解决办法修改配置文件

SDK根目录   === > tools ===> bin ===> uiautomatorviewer.bat ===> 鼠标右键以记事本打开 ==》找到platform-tools目录 ===》修改uiautomatorviewer.bat 文件中最后一行内容 ===》也就是下文中的标红的东西

你自己安卓SDK目录下的tools下的bin目录 下的uiautomatorviewer.bat

@echo off
rem Copyright (C) 2012 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem      http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0

rem Get the CWD as a full path with short names only (without spaces)
for %%i in ("%cd%") do set prog_dir=%%~fsi

rem Check we have a valid Java.exe in the path.
set java_exe=
call ..\lib\find_java.bat
if not defined java_exe goto :EOF

for /f %%a in ("%APP_HOME%\lib\uiautomatorviewer-25.3.1.jar") do set jarfile=%%~nxa
set frameworkdir=.

if exist %frameworkdir%\%jarfile% goto JarFileOk
    set frameworkdir=..\lib

if exist %frameworkdir%\%jarfile% goto JarFileOk
    set frameworkdir=..\framework

:JarFileOk

set jarpath=%frameworkdir%\%jarfile%

if not defined ANDROID_SWT goto QueryArch
    set swt_path=%ANDROID_SWT%
    goto SwtDone

:QueryArch

    for /f "delims=" %%a in ('%frameworkdir%\..\bin\archquery') do set swt_path=%frameworkdir%\%%a

:SwtDone

if exist "%swt_path%" goto SetPath
    echo SWT folder '%swt_path%' does not exist.
    echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
    exit /B

:SetPath
set javaextdirs=%swt_path%;%frameworkdir%

call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" "-Dcom.android.uiautomator.bindir=D:\Programer\ProgramerUtil\AndroidStudioSDK\platform-tools" -jar %jarpath% %*


 

注:红色的部分替换为你自己安卓SDK目录下的tools下的bin目录 下的uiautomatorviewer.bat

 这个是我的sdk 中的东西,你需要找到自己的sdk根目录下platform tools 路径替换红色部分就可了

2)Unexpected error while obtaining UI hierachy

解决办法替换文件

 文件下载地址

https://www.123684.com/s/lWZKVv-dZiav?提取码:pX3B

 

找到你自己的SDK安装目录下的tools目录下的lib文件  把文件复制进去就可以了

D:\Programer\ProgramerUtil\AndroidStudioSDK\tools\lib


http://www.kler.cn/news/367472.html

相关文章:

  • GoogleChrome的安装和使用
  • 三种材料的金相图及金相图解析材料
  • ThinkPad T480拆机屏幕改装:便携式显示器DIY指南
  • cherry pick commit
  • C++游戏开发
  • 【c++篇】:从基础到实践--c++内存管理技巧与模版编程基础
  • 在虚拟化环境中,虚拟机的资源分配是否真的能够完全等效于物理服务器?是否有某些特定的工作负载在虚拟化环境中始终无法达到理想表现?
  • 【ChatGPT插件漏洞三连发之一】未授权恶意插件安装
  • Chromium HTML5 新的 Input 类型search对应c++
  • 【C++ 真题】B2099 矩阵交换行
  • 5.Linux按键驱动-fasync异步通知
  • 微信支付Java+uniapp微信小程序
  • Netty简单应用
  • C语言教程——数组(2)
  • UML之用例图详解
  • Linux 常用命令总汇
  • 二、Spring的执行流程
  • 【webpack学习】
  • w003基于Springboot的图书个性化推荐系统的设计与实现
  • Padavan开启IPV6
  • 在css中使用js变量(待整理)
  • cc2530 Basic RF 讲解 和点灯讲解(1_1)
  • tkinter包中包含的colorchooser模块简介
  • 卷积神经网络:卷积层,池化层,全连接层
  • springboot2.6.15升级至3.3.4,Spring Framework升级至6.1.14
  • GIT使用list