Thursday, August 24, 2017

Is there a minimal installation of ADB?


When it comes to , I often read recommendations like "Use adb logcat to find some more details". Looking for a good way to backup all my apps including their data, Full Backup of non-rooted devices refers to adb backup and adb restore. In several places one can find ways to remotely do on an Android device with the use of ADB, such as transferring files using adb push or adb pull, accessing the via adb shell, and more. So ADB seems to be a good thing to have for an Android user.


But how to get this "ADB thingy" on my computer? Not being a developer, installing the entire Android SDK seems a bit overkill. Is there a more minimalistic approach available?




Answer



In fact, it is not necessary to install the entire SDK if one does not want to use it for development. To be able to run basic ADB commands in the context needed by an average user, a rudimentary installation is completely sufficient. I will try to explain how to do this, and hopefully cover the most used computer systems.


Requirements


First, you will need the basic binaries. These can be found e.g. in the Download area of my Android site, where I try to keep up-to-date versions available – for Linux, MacOS, and Windows.1


Windows users


If your computer is running Windows, you will also need the special drivers for your device (no generic solution here, so you need to check this out yourself; usually, those drivers are offered for download on the manufacturer's website).


Linux and Mac OS users


Linux and Mac OS users might need to make their device known to their operating system. For Linux, you find the necessary steps described in my answers here and here. Not being familiar with Mac OS, I can not speak for it.


Installation


Linux



For Linux, this is quite easy: Simply unpack the downloaded binaries into a directory of your choice. At the time I'm writing this, this will only be two files: adb and aapt (the latter being used by QtADB, and not necessarily needed to execute ADB commands directly). Adjust their file permissions to make them executable (e.g. from the command line: chmod 0755 adb aapt). Finally, it's a good idea to include the chosen directory with your $PATH variable, so you can call adb from wherever you are. A good place for that is at the end of your ~/.profile file to include an additional line like export PATH="~/bin:$PATH" (if you extracted the binaries to ~/bin).


Windows


The Windows download holds a couple more files. Also extract them into a directory of your choice. If you want them to be callable from wherever you are, without preceding the complete path, you need to add that path to your environment variables as well. Not being a Windows user, I must leave the "how to do this" to you.


What else?


You should be done at this point, and can use the full powers of the ADB command line.


Alternatives?



  • on some Linux distros, you can install the packages android-tools-adb and android-tools-fastboot via the resp. package manager. This has the pro of being updated automatically.

  • on OS X, you can use SimMac's installer

  • Update 1/2017: Google now offers direct links for the "always latest" platform tools, which include a.o. adb and fastboot:




Further readings





1: Also see Alex' answer for more alternative sources. My sources are the official Google downloads, just "stripped down".


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...