IoTGateway/BSP/Android/Gettingstarted/ADB install

From ESS-WIKI
Revision as of 09:48, 25 January 2017 by Liszt.kao (talk | contribs)
Jump to: navigation, search

If you’ve ever tried to root your Android phone or flash a ROM, you may have heard about ADB and/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. Google recently released ADB and fastboot as a standalone download. Now you don’t need to download a huge developer kit just to mod you’re phone! We’ve updated our guide below to reflect the changes and to use Google’s official download instead of third-party services.

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/modify things like 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 that’s an extremely large download that, frankly, most users who are interested in ADB and fastboot don’t need. Fortunately, Google recently made it easy to get these two without all the junk.

Download the Platform Tools Package

RTENOTITLE

Google collectively refers to ADB, fastboot, and a few other utilities as the Platform Tools package. You can download the Platform Tools package from the SDK website here. There are separate packages for Windows, Mac, and Linux so download the appropriate version for your platform.

Once you’ve downloaded the Platform Tools package, extract the contents of the .zip file to a folder you can find later (like “C:\Android\platform-tools”). You don’t actually need to install ADB and fastboot to use them, but you can take an extra step to make them more convenient for you.

By default, you’ll either have to navigate to the folder where you extracted the Platform Tools package and run any ADB or fastboot command from there, or write out the full path where ADB is every single time you want to run a command. For example, this is a simple command to see what devices are attached to your system:

<code>adb devices</code>

If your command prompt isn’t open to the location where you extracted the Platform Tools, however, you would have to type something like this:

<code>c:\Android\platform-tools\adb.exe devices</code>

That’s a pain to go through every single time you want to tweak something on your phone. To fix this, we can modify something called the PATH variable so that you can run ADB and fastboot commands no matter which folder you’re in.