android如何更新或者安装最新版本的ADB?

分享于 

6分钟阅读

ubuntu

  繁體

问题

我有一个android手机,需要ADB来安装新版本,

我试图删除ADB,:


sudo apt-get remove android-tools-adb android-tools-fastboot



然后我重新安装它:


sudo apt-get install android-tools-adb android-tools-fastboot



我下载了1.0.35 zip,但不知道该怎么办。

如何升级我的ADB?


答案1

你可以在这里下载最新的SDK(包含了adb),


Welcome to the Android SDK!



The Android SDK archive initially contains only the basic SDK tools. It does


not contain an Android platform or any third-party libraries. In fact, it


doesn't even have all the tools you need to develop an application.



In order to start developing applications, you must install the Platform-tools


and at least one version of the Android platform, using the SDK Manager.



Platform-tools contains build tools that are periodically updated to support new


features in the Android platform (which is why they are separate from basic


SDK tools), including adb, dexdump, and others.



To install Platform-tools, Android platforms and other add-ons, you must


have an Internet connection, so if you plan to use the SDK while


offline, please make sure to download the necessary components while online.



To start the SDK Manager, please execute the program"android".



From the command-line you can also directly trigger an update by


executing:


 tools/android update sdk --no-ui



Tip: use --help to see the various command-line options.



For more information, please consult the Android web site at


 http://developer.android.com/sdk/



安装后(如果还没有Java,就必须安装Java ),你可以导航到AndroidSDKLinux/平台工具,然后通过键入

 
./adb [options]



这可能不是最优雅的解决方案,但是它正常工作。


答案2

使用,


# adb version


Android Debug Bridge version 1.0.31


# wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb


# sudo mv adb /usr/bin/adb


# sudo chmod +x /usr/bin/adb


# adb version


Android Debug Bridge version 1.0.32




答案3

只安装最新的工具(不是整个sdk ),使用platform-tool,如下所示:


tools/android update sdk -t platform-tool --no-ui




答案4


mkdir ~/Android && cd ~/Android



下一步从Google下载并提取平台工具:


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




echo"alias adb='~/Android/platform-tools/adb'" >> ~/.bash_aliases && source ~/.bash_aliases



也可以选择fastboot


echo"alias fastboot='~/Android/platform-tools/fastboot'" >> ~/.bash_aliases && source ~/.bash_aliases



使用adb version检查当前安装的版本。


答案5

如果您运行的是64位版本的Ubuntu,则需要使用以下命令安装一些32位库:


$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386



然后安装adb和fastboot:


$ sudo apt-get install android-tools-adb android-tools-fastboot




$ wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb


$ sudo mv adb /usr/bin/adb


$ sudo chmod +x /usr/bin/adb


$ adb version




答案6

尝试这个Linux最小ADB和Fastboot工具https://www.gizdev.com/latest-minimal-adb-and-fastboot-tools/


答案7

/home/<USER>/Android/Sdk/platform-tools adb可执行文件的默认位置。

通过以下方式检查它的版本:

 
$ ./adb version



以下是可能找到的路径变量:


export ANDROID_HOME=$HOME/Android/Sdk


export PATH=$PATH:$ANDROID_HOME/tools


export PATH=$PATH:$ANDROID_HOME/tools/bin


export PATH=$PATH:$ANDROID_HOME/platform-tools



然后确保系统正在使用它:


sudo ln -s /home/<USER>/Android/Sdk/platform-tools/adb /usr/bin/adb



这将允许你从自定义安装目录中使用;/home/<USER>/Android/Sdk/platform-tools/adb



版本  ADB