What Is ADB And How To Install It With Android SDK

http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/

When it comes to Android modding, most novice users are confused or left wondering by reference over reference to a certain “adb”. This is specially true when you are looking up something on modding your device, or root it in particular. ADB is the wonder toy of Android and everyone seems to love it, so lets have a look at understanding what it is and why you need it, and how you can get it.

 

What Is ADB

ADB stands for Android Debug Bridge. It comes as a part of the standard Android SDK, which you can grab here. Basically, it provides a terminal-based interface for interacting with your phone’s file system. Since Android platform is based on Linux, command-line is the only way to obtain and manipulate root access often required to perform certain advanced operations on your device using root access.

While these things can be done directly on the device itself using some terminal emulator, it will be rather difficult to execute complex commands on such a small screen. ADB provides the bridge between your machine and your computer.

How To Install ADB

Step 1: Installing the Android SDK

Note: At the time of updating this guide, the latest version of the Android SDK available is r8 and we shall be using it throughout the rest of the guide. The tools will work the same way however, even if you get a later version. In case of earlier versions though, the location of some of the tools was different and it is recommended that you get the latest available version.

The first step is to download the SDK. Use the link given at the end of this post and download the latest version of the Android SDK from there. There are versions available for Microsoft Windows, Linux and Mac OS X. In case of Windows, both an installer and a zip file are available but there isn’t any need to use the installer as a formal installation is not required.

Once you have downloaded the SDK, simply extract the compressed file to a location on your computer. In our case, we have extracted it to the root of our C drive and that makes C:\android-sdk-windows the installation location of the SDK. From here onwards, we shall be referring to this location as the ‘SDK folder’.

Step 2: Downloading the SDK Platform Tools

Previously, ADB used to be included in the SDK by default in the ‘tools’ sub-folder but now, it has been relocated to the ‘platform-tools’ sub-folder which needs to be downloaded as an SDK package. Fortunately, this is quite easy:

Just browse to the SDK folder and launch SDK Manager. When launching it for the first time, it will present you with a window to choose packages to install. The first option begins with ‘Android SDK Platform-tools’. Make sure it is checked, and uncheck all the other packages for now. You can check/uncheck a package by clicking on its name and then selecting the Accept/Reject radio button. Your window should look like this:

Now simply click ‘Install’ and wait till the platform tools are installed. Once the process is done, you will have a ‘platform-tools’ folder inside your SDK folder. That folder will include ADB and all its dependencies.

Step 3: Setting the Path variable

Now you have ADB installed but using it this way will require you to either use the complete path of the ADB command (C:\android-sdk-windows\platform-tools\adb) or to first change directory to the platform-tools subfolder of the SDK folder each time, and this can become quite a hassle. To make ADB along with other Android SDK tools and platform tools easily accessible from anywhere at the command line, we shall add their paths to the PATH environment variable. This method will apply to Windows users only. If you are a Linux or Mac user, add the ‘tools’ and ‘platform-tools’ sub-folders of the Android SDK to your system’s PATH variable using the standard method for your operating system.

  • If you have no experience with editing system environment variables, make a System Restore point now so that you can revert back to it in case something goes wrong.
  • If you are using Windows 7, right-click the ‘Computer’ icon and click ‘Properties’. Now click ‘Advanced System Settings’ from the options in the left pane to bring up the ‘System Properties’ window. Windows XP users will directly get this window when they right-click ‘My Computer’ and click ‘Properties’.
  • In the ‘System Properties’ window, click the ‘Environment Variables’ button on the ‘Advanced’ tab.
    Pathchange
  • Find ‘Path’ in the ‘System variables’ section and double-click it to edit it.
  • Make sure NOT to delete the existing entry in ‘Variable value’ or it will mess up things on your computer. Just add the following string to the end of it, including both the semi-colons:
    ;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools

    If you have extracted the SDK’s contents to another directory, make sure to use that one for your PATH variable.

After adding the string, this is what my Path variable looks like:

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Java\jdk1.6.0_23\bin;C:\Program Files (x86)\Java\jdk1.6.0_23\bin;C:\android-sdk-windows\tools;C:\android-sdk-windows\platform-tools

Don’t worry if yours does not include some of the other text – what is important is the way the new entry should be added to the existign one, and the way the previous entries MUST be left unchanged. Notice that the semi-colons are necessary to separate each path variable entry from the next and previous ones. Once you have added the path, your machine may require a reboot.

In case you messed up while editing the Path variable and ended up deleting the previously existing entries, just restore the System Restore point you made and retry, being more careful this time.

Step 4: Installing the USB drivers

Finally, you need to install the USB drivers. You may or may not need to perform this step, depending on your device. If you are using a device that ships with stock Android operating system such as the Nexus One, this will be necessary. In case of other devices that ship with their custom version of Android and some tools to sync the device with the PC, such as devices from HTC that ship with HTC Sync or devices by Samsung that ship with Samsung’s own software, the suitable driver for your device will be automatically installed with that software package.

    • The first step will be to download the USB drivers. To do this, launch SDK Manager from the SDK folder and click on ‘Available packages’ in the left pane.
    • Expand ‘Third party Add-ons’ followed by ‘Google Inc. add-ons’ and check ‘Google Usb Driver package’, as shown in this image:

  • Click ‘Install Selected’ and in the window that pops up, click the ‘Accept all’ radio button followed by the ‘Install’ button. Wait patiently while the USB drivers are downloaded and installed in the Android SDK.
  • The drivers for both 32 bit and 64 bit systems will now be present in the SDK folder under ‘usb_driver\x86′ and ‘usb_driver\x64′ sub-folders respectively.

Now that the USB drivers have been downloaded, you can install them to your computer as follows:

  • On the device, go to home screen, press Menu, select Applications > Development, and enableUSB Debugging.
  • Now connect your phone to the PC via USB. New hardware installation should kick in, and it will start looking for the drivers.
  • Manually point the drivers to the folder suitable for your operating system and let them install.
  • Once drivers have installed, you can verify successful installation by going to Device Manager. Your phone should be showing under ‘ADB Interface’, like in this example:

How To Use ADB

At this point, the setting is done. Here on you can simply use adb to manipulate your phone in whatever way you like. On Windows, the best way to do so is using command prompt. To ensure that adb has been set up properly, run command prompt and type ‘adb devices’ and hit enter. Your connected device should show up with a serial number.

cmd

This is it for this guide. We would like to emphasize that playing with your phone at this level can be dangerous if you don’t know what you are doing, and can even render the phone completely useless. Please do it at your own risk.

For a complete list of adb commands, check out the official adb guide here.

Download Android SDK

Editor’s Note: ADB is for advanced users only. If you need ADB with a Graphical User Interface, check out QtADB.

你可能感兴趣的:(android sdk)