Search This Blog

something

How to setup ADB & Fastboot: The Easy Way

ADB, aka Android Debug Bridge, and Fastboot: These two tools are very helpful for the "Above average" Android users. Many-a-times these tools act as lifesavers and get your device out of scary situations like stucking at boot animation/ splash screen or a soft brick. You can use these tools to flash recoveries which can then be used to flash ROMs, to flash splash screen, to pull out and push applications and other data onto the device.
Note: You need to have a decent Internet connection for downloading ~200 MB data.


Follow the below steps one by one. Mention the step number in which you are facing any problem (in case, you face any) in your comments.
  1. Download latest Java SDK (Download x64 version for 64 bit windows and x86 for 32 bit windows) and install it to the default location i.e. don't install it to some different location, let it install where it's default location is set to.
  2. Download Android SDK and install it. You need to install Java SDK before installing the Android SDK as the former is required by the latter to work.
    Note: If during the installation, you see an error stating Java SDK couldn't be found or something like that, go to the previous step and then try again, it should work fine now. This happened in my case, maybe it's specific to the version I installed.
  3. Run SDKmanager.exe and download Android SDK Platform tools from the list of available packages to install.
    Select the highlighted run as administrator option

    Note: Right click on the SDKmanager.exe and select Run  as Administrator. If you start it normally, it won't be able to connect to the internet and you will see an error message like the below one:
    "Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: Permission denied: connect"
    Turning USB Debugging On

  4. Enable USB Debugging on your device by visiting Settings > Applications > USB Debugging and tick the check box. Leave this step if you have already got it turned on.
  5. Download Pdanet for PC from here or here and during the installation, select your device manufacturer (if it's not in the options, select others). It will then ask you to plug in your device to complete driver installation. Almost all phone's drivers get installed this way.
    Else if your manufacturer provides drivers for your device, then skip this step i.e. step 5, and install those drivers instead.
  6. With your phone connected to the PC using USB cable in normal switched on condition (i.e. neither USB storage or USB tethering should be on). Go to C:\Program Files\Android\android-sdk\platform-tools and right click anywhere in the folder while pressing the shift key and select open command window here. Give the command "adb devices" and your device should be listed there. That's it. You have got adb working for your device.
    This is how the ADB screen looks like when ADB has been setup correctly

    Note: Change the path 
    C:\Program Files\Android\android-sdk\platform-tools to wherever you have installed the Android SDK. The path above is the default location Android SDK gets installed to.
  7. Download the fastboot binary here. Boot your device into fastboot by pressing the key combination for your device. (Google 'your_device_name key combination enter fastboot mode' to know the key combination for your device or ask someone at xda in your device's section. Generally, it is power up + camera button. Whatever the key combination is, first switch off the device, then press those keys simultaneously till the screen lits up.)
  8. Go to the folder in which you extracted the fastboot thing that you downloaded above and open a command window there (by pressing shift + right click in the folder). Connect your phone in fastboot mode using USB cable and give the command "fastboot devices". If your device is listed there, then congrats. Both ADB and Fastboot are ready to serve you any time.
The final Fastboot screen showing the devices attached
Some Basic Commands you might find useful

Pushing any file to phone via ADB:
adb push <file location on PC.apk> <path to save file on phone>    Like this one: adb push d:\songs\xyz.mp3 /system/media/ringtones

Pulling any file via ADB:
adb pull <file location.apk> <path to save file on PC>   Like this one: adb pull /data/app/Stock.apk C:\

Installing any App via ADB:
adb install <file location on PC>   Like this one: adb install c:/apps/xyz.apk

Uninstalling any App via ADB:
adb uninstall <app name>   Like this one: adb uninstall crap.apk

Flashing custom recovery via Fastboot:
fastboot flash recovery <recovery name>     Like this one: fastboot flash recovery cwmrecovery.img

Erasing any partition via Fastboot:
fastboot erase <partition name>     Like this one: fastboot erase recovery

Other commands listed on giving "Fastboot" command:
Fastboot help screen


If you aren't able to get ADB and Fastboot working for your device, explain your problem in the comment section below. I shall do my best to help you.
Note: If you have installed pdanet/ easy tether/ any similar app, disconnect the device from the app and exit all of them from the task manager to ensure ADB and Fastboot work correctly.
Have a nice day.