001、uiautomator2 环境准备


一、uiautomator2 环境准备

1、安装jdk8,并配置环境变量我的如下:

 

验证安装是否成功,输入如下指令:

C:\Users\M108112>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

C:\Users\M108112>

2、安装Android SDK , 并配置adb、aapt

     我用的是 Android studio 工具 里面的 Android SDK

 验证adb指令如下:

C:\Users\M108112>adb --version
Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
Installed as D:\SkyWorkSpace\Work_Tools\android_studio_ide\Android_SDK\platform-tools\adb.exe

C:\Users\M108112>

验证aapt如下:

C:\Users\M108112>aapt
Android Asset Packaging Tool

Usage:
 aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.

 aapt d[ump] [--values] [--include-meta-data] WHAT file.{apk} [asset [asset ...]]
   strings          Print the contents of the resource table string pool in the APK.
   badging          Print the label and icon for the app declared in APK.
   permissions      Print the permissions from the APK.
   resources        Print the resource table from the APK.
   configurations   Print the configurations in the APK.
   xmltree          Print the compiled xmls in the given assets.
   xmlstrings       Print the strings of the given compiled xml assets.

 aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \
        [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \

3、安装python,我的如下:

     安装python时,记得勾选添加至环境变量;

C:\Users\M108112>python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

4、在 pycharm 中 安装 uiautomator2 库,我安装的情况如下:

 

其他辅助工具:
5、找到 uiautomatorviewer.bat ( 定位元素辅助工具 )并发送到桌面快捷方式

     我的所在路径为:D:\SkyWorkSpace\Work_Tools\android_studio_ide\Android_SDK\tools\bin\uiautomatorviewer.bat

     

 

相关