給電腦安裝adb,參考了一些網絡文章,發現大多使用了國外資源下載,速度慢的受不鳥。總結下快速安裝的方法。
下文引用部分,是在Mac-終端中運行的命令。
1、安裝Homebrew,使用中科大鏡像。(已安裝的可忽略)
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
該腳本內置中科大鏡像,速度較快;
2、替換 brew 程序本身的源,使用清華的源;
git-C"$(brew--repo)"remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
更換上游后需重新設置 git 倉庫 HEAD:
brew update-reset
3、安裝adb
brew install android-platform-tools
運行adb
adb devices
參考文檔:
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
https://blog.csdn.net/m0_46197393/article/details/106752367