Mac系统安装adb
The Android Debug Bridge (ADB) is a command-line tool that can be used to install, uninstall and debug apps, transfer files and access the device's shell.
adb全称Android Debug Bridge,简单说就是通过命令行调试手机,特别是当手机gg进不了系统时会很有用。
安装homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Homebrew 安装:
brew reinstall --cask android-platform-tools
配置环境变量:
打开终端,入当前用户的home目录
打开.bash_profile文件,如果不存在先创建,可以用vim
open .bash_profile
在文末加入:
export ANDROID_HOME=/Users/yourname/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools
在终端输入:
source .bash_profile
输入adb devices,验证是否安装成功,成功如下:
strengthen@strengthen ~ % adb devices
List of devices attached
UQG5T20526008152 device
常用ADB命令:
adb push 电脑端路径 手机端路径 用于将文件推送到手机 adb push D:/DCIM /sdcard/ 即可从将D盘的DCIM文件夹复制到存储根目录 adb reboot 参数 adb reboot 手机会正常重启 adb reboot recovery 手机会重启到recovery卡刷模式 adb reboot bootloader 手机会重启到bootloader(fastboot)线刷模式

浙公网安备 33010602011771号