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測試

相關文章
相關標籤/搜索