Sunday 30 December, 2012

Setting up ADB for your android

I just thought of it and here's a tutorial!! 
ADB (Android Device Bridge) is generally used when you just screw up your phone by messing with something that shouldn't have been done :D or rather experimenting!!
But adb can help you a long way when you get in such difficulties!!
So here we go step by step!:

I. Setting Up The Android SDK

  1. Download the latest SDK from the android developer site!! http://developer.android.com/sdk/index.html
  2. Install it as you would do any application but for convinience change the folder to C:/Android-sdk
  3. Click on the SDK manager from your programs menu and then install the following packages             a) Android Sdk tools b) Platform tools c) Google usb drivers package. (latest 1 available) (Note: Make sure you have open the sdk manager as Administrator or else it will give error)
  4. Now on your phone go to settings-applications-development-usb debugging on if you are on gingerbread or settings-Developer options-usb debugging if Ice Cream Sandwich and above.
  5. Now plug in your phone and let the system install the drivers and set up and it will say "ADB Device found"
  6. Now all you need to do is go to C:/Android-sdk/platform-tools and then "press shift key and left click of your mouse and select the open command window here"  if you are using windows 7! For XP first go to Start > Run > then typing in cmd and hitting enter and then type "CD C:\andoid-sdk\platform-tools" and then continue!
  7. Now type "adb devices"  your device would be listed below!

II. Install Fastboot

1. Download fastboot.exe and save it to your computer.
2. Unzip it, then copy the fastboot.exe file into the platform-tools folder of your Android SDK.
3. Now, you can type fastboot commands in command prompt in the same place you typed adb commands.

III. Common ADB/Fastboot Commands

ADB Commands
adb devices – lists which devices are currently attached to your computer
adb install <packagename.apk> – lets you install an Android application on your phone
adb remount – Remounts your system in write mode – this lets you alter system files on your phone using ADB
adb push <localfile> <location on your phone> – lets you upload files to your phones filesystem
adb pull <location on your phone> <localfile> – lets you download files off your phones filesystem
adb logcat – starts dumping debugging information from your handset to the console – useful for debugging your apps
adb shell <command> – drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly
adb devices – lists which devices are currently attached to your computer
adb install <packagename.apk> – lets you install an Android application on your phone
adb remount – Remounts your system in write mode – this lets you alter system files on your phone using ADB
adb push <localfile> <location on your phone> – lets you upload files to your phones filesystem
adb pull <location on your phone> <localfile> – lets you download files off your phones filesystem
adb logcat – starts dumping debugging information from your handset to the console – useful for debugging your apps
adb shell <command> – drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly
Fastboot Commands
fastboot devices – lists which devices in fastboot mode are currently attached to your computer
fastboot boot <filename> – boots a rom stored on your pc specified by the filename
fastboot flash <partition> <filename> – flashes a rom stored on your pc, partition can be one of {boot, recovery, system, userdata}

That's it!! do it now!! 
Cheers!!

No comments:

Post a Comment