Android 配置 ADB

时间:2022-04-01 18:49:41

一、macOS 配置 adb

1. 方法一:使用 Android Studio 自带的 adb 配置

  ① $ touch .bash_profile

  ② $ open -e .bash_profile

  在打开的文件添加如下两行:

    export PATH=${PATH}:~/Library/Android/sdk/platform-tools

    export PATH=${PATH}:~/Library/Android/sdk/tools

  ③ 查看 adb

  $ adb
  Android Debug Bridge version 1.0.39
  Version 0.0.1-4500957
  Installed as ~/Library/Android/sdk/platform-tools/adb

2. 方法二:通过终端 breview 配置

  ① 安装

  $ brew cask install android-platform-tools

  最后显示 android-platform-tools was successfully installed! 说明安装成功。

  ② 查看 adb

  $ adb
  Android Debug Bridge version 1.0.41
  Version 29.0.4-5871666
  Installed as /usr/local/bin/adb

  ③ 卸载

  $ brew cask uninstall android-platform-tools

  ==> Uninstalling Cask android-platform-tools
  ==> Unlinking Binary ‘/usr/local/bin/adb‘.
  ==> Unlinking Binary ‘/usr/local/bin/dmtracedump‘.
  ==> Unlinking Binary ‘/usr/local/bin/etc1tool‘.
  ==> Unlinking Binary ‘/usr/local/bin/fastboot‘.
  ==> Unlinking Binary ‘/usr/local/bin/hprof-conv‘.
  ==> Unlinking Binary ‘/usr/local/bin/mke2fs‘.
  ==> Purging files for version 29.0.4 of Cask android-platform-tools

2. 方法二: