December 20, 2014

How to Use ADB (Android Debug Bridge)

We’ve received quite a few questions about what ADB is and how to use it.  In the hours that passed after the post about custom ROMs for the Xperia X10, we saw enough come in to merit a post.  So, we thought it might be worth helping out you out and answer a couple of questions.  Although ADB features a lot of complicated functions, we’ll just do the basic stuff, assuming the average Android user has no need to know about debugging your applications, right?

We could immediately start with the functions, but because you can’t do anything without the ADB program, here’s where to find it. ADB is a part of the Android SDK, the program developers use to develop their application. You can find it here. Just select the right file for your computer (Windows, OS X or Linux) and unzip it.

OK, now we’re ready to get started. Navigate to the folder where you unzipped the SDK and follow this path: “android-sdk_r07-windowsandroid-sdk-windowstools” Here you see a whole lot of .bat and .exe files, but for now, the only one interesting is adb.exe. When you launch adb.exe, nothing happens. A little screen pops up and disappears as soon as it popped up. So we’ll have to open it another way.

If you’re on Windows, do this: Click Start > Run > cmd. Now you’re in the Windows Shell, a little remain of the oldskool MS-DOS. Now type: “cd “the directory where you put the SDK”android-sdk-windowstools. Now you’re in the folder where ADB is located.

If you want to use your phone with ADB, which is highly probable and why this article is written, it has to be in USB Debugging Mode. You can turn this on in your settings, but that’s really easy, we won’t need to help you with that. First, we want to know whether your device is recognized or not. Therefore, type in the Shell: “adb devices” You should get a screen like this:

You’re probably thinking: “Are we done yet?” The answer is, yes we are. Now you know how to reach ADB and how to execute commands with it. Always remember to put “adb” in front of the command you want to use, unless “adb” is included in the command.

Do you want to know more? An in-depth article about ADB and what you can and can’t do with it? Email your suggestions and requests to me at thijs[at]androidguys.com



  • Michael

    And if you’re using a Mac?

    • Tom

      Get a computer!

  • http://androidguys.com Thijs Koot

    I’ll honestly tell you I don’t know. I don’t own a Mac, but I guess it’s quite a similar process to Windows.

    • Zack

      Do it on mac via the Unix shell. Open the application “Terminal”, change directory to /android-sdk-mac_86/tools where you can type “adb ” then whatever. You can also apparently add “adb” to your profile or config file and access it from anywhere, but I’m not sure how to do this.

  • selvam

    Hi,
    I would like to know about the Debugging of Android application with ARM Coretx -A8 developmet board through ADB using USB interface. I preferred to know about more details of step by step debugging through ADB.
    Kindly guild me on this.

    Regards
    Selvam

  • http://koowie.com Peter Shen

    This is very useful. Thanks.

  • Idiot Noob

    DUDE YOUR A FUCKING LIFE SAVER THANK YOU!!!!!!!!!!!!!!!!!!!!!

  • Idiot Noob

    DUDE YOUR A FUCKING LIFE SAVER THANK YOU!!!!!!!!!!!!!!!!!!!!!

  • Cielo Marie Navarro

    What if my device is not recognized? Why is this so? Im using Galaxy S II

  • Nomailpleas

    great! Many thanks for your useful article.

  • William Normanton

    the SDK kit you linked to is a nightmare now. adb is not there, you have to do some painfully geeky stuff to get it. 

    if anyone is stuck, just download superoneclick (google it) – it comes with adb

  • help

    i on’t get what i’m suppose to type when i’m in windows shells

  • sjc

    people now adb is in platform-tools directory not in tools. :)

  • Dinesh Prajapati