Thread: General Setting Up ADB
View Single Post
Old November 1st, 2011, 08:20 PM   #1 (permalink)
nuttmeg
Senior Member
Thread Author (OP)
 
nuttmeg's Avatar
 
Join Date: Feb 2011
Location: Lone Star State
Posts: 7,330
 
Device(s): (SGS3)(Evo 3D)(LG Esteem)(Kindle Fire CM10)(Note 2)(LG L9)(LG F3)(Galaxy Note 3)
Carrier: Not Provided

Thanks: 1,800
Thanked 2,536 Times in 1,730 Posts
Send a message via Yahoo to nuttmeg
Default Setting Up 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.
  • 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%;%SystemRoo t%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowe rShell\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:
    This image has been resized. Click this bar to view the full image. The original image is sized 745x433.
  • 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 enable USB 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 PUSH FILES

Prerequisites have...
A:android-sdk-windows installed
B: (on your phone) go to menu>settings>applications>developement and make sure usb debugging is checked.
C: the file you are pushing must be placed in the tools folder of adb so if you are pushing file "build.prop.txt" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\tools
1: go to run and type cmd (or just open your command prompt)
2: cd C:\android-sdk-windows\tools
3: adb remount
4: adb devices *if everything is set up right this should output a serial number*
5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices example adb push build.prop.txt /system/bin
6. repeat step 3 for multiple files
7. adb reboot this is how you finish
__________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Join our Android Facebook Page Droidz DNA
Sign up for @copyapp with this link, and we'll both get 5 GB of free cloud storage in addition to the usual 15 GB: https://copy.com?r=bMXFAm
nuttmeg is offline  
Last edited by nuttmeg; December 19th, 2011 at 11:13 PM.
Reply With Quote
The Following 12 Users Say Thank You to nuttmeg For This Useful Post:
ARocker (November 25th, 2013), Can0dope (November 3rd, 2011), countryboy0927 (August 16th, 2012), gbiggie (March 17th, 2012), Gmash (November 2nd, 2011), intrdrgn (November 2nd, 2011), KOLIO (November 1st, 2011), Kuzco (November 1st, 2011), Scur (November 5th, 2011), ShinySide (November 13th, 2011), Skeezits (November 24th, 2011), swtnss (November 15th, 2011)