adb工具介绍与安装

  • 一天笑嘻嘻是一名测试人员,想了解Android的测试方法,因而,就找到了小测试。
  • 笑嘻嘻:身为一名测试人员须要了解ADB的哪些内容?
  • 小测试:了解原理和简单的命令使用就能够了。
  • 笑嘻嘻:你有毒啊,都了解原理了,还简单实用?
  • 小测试:用工具不疑,疑工具不用,知道这个工具怎么运行的用起来才驾轻就熟啊。另外ADB命令就像Linux的命令同样,记住经常使用的,了解大部分的,遇到问题知道百度什么就好。

ADB介绍

  • [ ] ADB即Android Debug Bridge,是Android提供的一个通用的调试工具,是一个C/S架构的命令,用这个工具能够直接操做管理android模拟器或者真实的android设备。
  • [ ] ADB是一个客户端/服务器架构的命令行工具,主要由3个部分组成。
    image
    • Adb clent(客户端):能够经过它对Android应用进行安装、卸载及调试。
    • adb service(服务器):管理客户端到Android设备上abd后台进程的链接。
    • adb daemon(守护进程):运行在Android设备上的adb后台进程。android

      ADB安装

      安装方法大同小异,不少文章都推荐安装Android sdk,其实adb工具是包含在Android sdk平台工具软件包里的一个,咱们把adb下载了就好。举个例子:王者荣耀是应用宝的一个应用,若是咱们要玩王者荣耀,须要把全部的应用都下载了么?固然不须要。
      image
      下载连接服务器

获取platform-tools和tools的文件路径

得到到上面的安装包或者安装好Android SDK以后,找到:platform-tools文件夹(复制路径)
image架构

添加环境变量

因为咱们的adb命令是在cmd环境下使用,全部要添加环境变量ide

  • 右键点击此电脑
  • 高级系统设置
  • 高级
  • 环境变量
  • 系统变量(建议是系统变量)
    image
  • 点击编辑
  • 新建
  • 把platform-tools和tools(tools在platform-tools下面)的路径添加进来。工具

    • 打开cmd环境,输入adb,回车,若是有出现下面的,恭喜你,安装成功!!!
C:\Users\wy.DESKTOP-KENPKKP>adb
Android Debug Bridge version 1.0.36
Revision 0e9850346394-android

 -a                            - directs adb to listen on all interfaces for a connection
 -d                            - directs command to the only connected USB device
                                 returns an error if more than one USB device is present.
 -e                            - directs command to the only running emulator.
                                 returns an error if more than one emulator is running.
 -s <specific device>          - directs command to the device or emulator with the given
                                 serial number or qualifier. Overrides ANDROID_SERIAL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.
                                 If -p is not specified, the ANDROID_PRODUCT_OUT
                                 environment variable is used, which must
                                 be an absolute path.
 -H                            - Name of adb server host (default: localhost)
 -P                            - Port of adb server (default: 5037)
 devices [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number is specified.
                                 Using this command with no additional arguments
                                 will disconnect from all connected TCP/IP devices.

今天就先到这里,若是有问题的请留言指正。
QQ:1545626293
image测试

相关文章
相关标签/搜索