If you’ve ever tried to root your Android phone or flash a ROM, you may have heard about ADB or fastboot. These two tools are surprisingly powerful, but can be a bit overly complex to install. Here’s how to do it the easy way.
What are ADB and Fastboot?
These two tools allow you to send terminal commands to your phone from your computer via USB. They both serve different functions, but they can be installed with relative ease at the same time, so it’s helpful to have both. Here’s a (very) brief breakdown on what these tools do:
- Android Debug Bridge (ADB): This tool allows you to send a wide array of terminal commands — including but not limited to basic Linux shell commands, plus some specialty developer commands — to your phone at just about any time (as long as you have debugging enabled on your phone). You can send commands while the phone is turned on and booted, or even when it’s in recovery mode. While ADB is often used in conjunction with rooting or modifying your phone, you can use ADB to send terminal commands to unrooted devices as well.
- Fastboot: When you need to modify your phone’s firmware, fastboot is the tool you need. This allows you to send commands to the bootloader, which means you can flash or modify custom recoveries. You can’t flash whole ROMs with it, but it’s helpful for many things that ADB can’t do. Fastboot isn’t enabled for all phones, so you may have to check your specific device.
Both of these tools come with the Android SDK, however this is an extremely large download that, frankly, most users who are interested in ADB and fastboot don’t need. If you just want to root your phone, flash some ROMs, and mess around in the terminal without having to muck about with complex button combinations, skip the SDK. Here’s how.
Windows is one of the most notoriously difficult operating systems to get ADB and fastboot working on because, unlike the other UNIX-based OSes we’ll get to, it has driver issues that can cause headaches. Fortunately, some enterprising XDA users have done the legwork to make the process much easier, and you don’t even need to download the full Android SDK to do it.
If you’re only interested in ADB, you can use this 15-second ADB Installer, however we’re going to go ahead and kill two birds with one stone and get fastboot while we’re at it (which is handy for unlocking those lovely Nexus devices). For that, we’ll use the Minimal ADB and Fastboot tool. Download and run the .exe file in this XDA thread. This will automatically install ADB and fastboot. Follow the wizard’s instructions and you’re done. Yes, seriously.
The program will ask you if you want to create a shortcut in your Start Menu or on the desktop. This shortcut will actually only open a command prompt in the folder where you installed ADB and fastboot. If you prefer to use this shortcut, you’re fine. However, you can also modify your PATH variable to include the folder ADB and fastboot were installed to (by default, it’s C:Program Files (x86)Minimal ADB and Fastboot) , so you can run those commands from any command prompt no matter what folder you’re in.
To simplify the process of installing ADB and fastboot on OS X, WonderHowTo sub-blog HTC One softModder created a script to automate the download and installation of ADB and fastboot. Don’t worry, despite the name of the blog, this script should work for any Android phone that ADB or fastboot would already work on.
To install the tools:
- Download this zip file containing the scripts.
- Extract the zip and place the Android folder on your Desktop.
- Open a new Terminal window.
- Enter cd Desktop/Android
- Enter ./ADB-Install-Mac.sh
The script will take a little time to run. When it’s done, you’ll be able to run ADB and fastboot commands from a Terminal window.
Like many things, installing ADB and fastboot on Linux should be a one-command affair. The only reason you may have a problem is if your distribution doesn’t come equipped with the proper repositories. If not, you can easily add the necessary repositories with a second command. If you’re on Ubuntu, you can skip the repository step below and move on to the install command.
To add the necessary repositories (maintained by the official Ubuntu Phablet Team), enter and run this command:
sudo add-apt-repository ppa:phablet-team/tools && sudo apt-get update
Once that’s done (or if you’re on Ubuntu), enter the following command:
sudo apt-get install android-tools-adb android-tools-fastboot
And you’re all set up! You can send commands to your device from any terminal window.