Android Debug Bridge Guide


This guide and the information indulged in it, is meant for anyone and everyone related to Android. You shall find its necessity at several occasions like taking logs, flashing firmware images, updating phone software, flashing ROMs/Recoveries even while developing a ROM/Kernel/Application. So, from users to developers, it will come in handy.

What is ADB?

ADB or Android Debug Bridge, is a fully equipped and loaded command-line tool which is put to use in order to communicate with an Android device. ADB tool is provided along side the Android SDK and one could easily find this tiny but versatile tool under /platform-tools/
It comprises of three basic and important components:

  • The Client
    It is what runs on your development machine
  • The Server
    It is held responsible for communication between the client and daemon running on a device/emulator
  • The Daemon
    It runs as a background process on each device/emulator instance
Now, lets see how can a user set up ADB on his various OS incl. Windows, Linux; Mac. Since ADB is bundled with Android SDK, so you need it prior for your respective OS. Below are few easy steps to setup ADB easily on your OS without much hassle. SDK and ADB work on JAVA, so make sure that you have JDK running on your OS.

How to Setup ADB on Windows

  1. Download the Android SDK package for Windows [Android SDK]
  2. Extract the zip files to your C:\ drive. Now you have a folder android-sdk-linux
  3. Double click on SDK Manager to initiate the SDK manager. You shall perceive the following window.
  4. Make sure everything is un-ticked. Now select Android SDK Platform-tools and install it.
  5. During the next window, you will be prompted. Accept the license and click on Install.
  6. When the installation is complete, close the window.
  7. The SDK manager has now download the platform-tools successfully, which certainly includes our prior ADB.
  8. The next step is to define the path where ADB is present.
  9. Go to C:\android-sdk-windows\platform-tools and take note of this path.
  10. Go to desktop, right click on Computer and select Properties.
  11. On the left pane, click on Advanced System Settings and a new window shall open.
  12. Select Environment Variables under Advanced tab.
  13. Select Path variable and click edit.
  14. Now add the path we noted in step #9 to the variable value and hit OK.
  15. Confirm and apply all the changes.
  16. To confirm that ADB has been configured properly, open CMD window and type in:adb
  17. You now have ADB successfully installed and configured on your Windows machine.
Some ADB commands 

1. Turn on ADB

Go to Menu; Settings; Applications; Development; USB Debugging


2. Running ADB

Open up command prompt and type your way to the directory you have your SDK in.

Mine is in C:\

So for example, mine would be: cd c:\AndroidSDK/tools

You are now in


3. Basic ADB commands

ADB push (sends files to your phone) -- adb push c:\example.apk /sdcard/example.apk

ADB pull (Receives files from your phone) -- adb pull /system/app/example.apk c:\example.apk

ADB install (installs application) -- adb install c:\example.apk

adb shell (Begins shell connection with phone)

adb reboot (reboots phone)

adb reboot recovery (reboots phone into recovery)

adb reboot bootloader (reboots the phone into bootloader/the white screen)

adb remount (remounts the system)


4. Commands to run while in ADB Shell

cd (changes directories) -- cd /system/app

ls (lists all files in the directory) -- cd /system/app

rm (removes files) -- rm /system/app/example.apk

cp (copies files) similar to cat -- cp /system/app/example.apk /sdcard/example.apk

cat (copies files) -- cat /system/app/example.apk > /sdcard/example.apk

exit (exits shell) -- exit





No comments:

Post a Comment