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

我有一个基于安卓的手机,我需要ADB来安装新版本。然而,直到今天,ADB还在完美地工作,但今天我得到了一个错误,它说"你需要1.0.32或更新的版本"是的,错误已经很清楚。问题是,怎么做?

为了记录在案,我已经尝试删除ADB。 用:

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

然后我重新安装了它,用:

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

在这个命令之前,我的ADB版本是1.0.31,仍然是1.0.31。但在这里(http://developer.android.com/sdk/index.html#Other),我看到有新的版本,1.0.35。但在终端上,我得到的是1.0.31。 我已经下载了1.0.35的压缩包,但我不知道该如何处理它。

我怎样才能升级我的ADB?

如果你认为,你有最新的SDK,但adb工具是旧的、

请使用、

# 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

参考 http://bernaerts.dyndns.org/linux/74-ubuntu/328-ubuntu-trusty-android-adb-fastboot-qtadb

评论(4)
解决办法

你可以下载最新的SDK,包括adb这里。 当你解压缩这个档案时,有一个解释如何安装SDK的readme。 我把它列在这里供你参考。

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,你必须安装它),你可以导航到android-sdk-linux/platform-tools,并从那里输入adb来执行

./adb [options]

我承认这可能不是最优雅的解决方案,但它对我来说是有效的。 我记得在另一台Ubuntu机器上,我只用platform-tools而不用Java来进行最小化安装,但我找不到这方面的笔记。

评论(7)

在Organic Marble'的回答上做了改进,为了只安装最新的工具(而不是整个SDK),可以使用下面的平台-工具过滤器:

tools/android update sdk -t platform-tool --no-ui
评论(1)