代码改变世界

Mac OS最简方式安装adb

2021-04-25 13:54  Tanwheey  阅读(1747)  评论(0编辑  收藏  举报

1、安装 Homebrew, 

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh

命令输入后出现报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused,注意这里问题后缀是Connection refused

前言: Homebrew是Mac上非常优秀的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。

解决办法:

(1)打开网站: https://www.ipaddress.com/,查询 raw.githubusercontent.com对应的IP 地址

 

 

(2)ping下ip:

 

 

 (3)使用switchhost或命令行修改系统的host文件

命令行安装:$sudo vi /etc/hosts

新增:

#安装Homebrew

185.199.108.133 raw.githubusercontent.com

(4)执行安装Homebrew命令:

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)

 

2、 安装adb及测试adb

$brew install android-platform-tools

 

 

 

$adb devices

 

 

 

3、查看adb安装的位置

$ brew info android-sdk