Fork me on GitHub

  1. 获取最新的adb包

wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip

  1. 将软件包解压到指定位置

sudo unzip -d /usr/local/sbin platform-tools-latest-linux.zip

  1. 获取adb、fastboot脚本

sudo wget -O /usr/local/sbin/adb https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/adb

sudo wget -O /usr/local/sbin/fastboot https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/fastboot

  1. 修改adb、fastboot权限

sudo chmod +x /usr/local/sbin/platform-tools/adb /usr/local/sbin/adb

sudo chmod +x /usr/local/sbin/platform-tools/fastboot /usr/local/sbin/fastboot

至此,adb已经成功下载安装,最新的ubuntu中,默认/usr/local/sbin不在环境变量中,所以我们需要将路径加入环境变量:

sudo vim /etc/profile

在文件的最后一行写入

export PATH=/usr/local/sbin:$PATH

最后执行source /etc/profile,刷新配置文件使得修改生效,如果个人配置文件中有配置受到影响,再执行一遍source ~/.profile即可。

 

1参考文档:
A https://www.jianshu.com/p/588df81117ce

posted on 2019-11-15 14:37  虚生  阅读(6045)  评论(0编辑  收藏  举报