What is ADB? How to connect my phone via USB using ADB?

Tell me bro
4 min readApr 6, 2022

--

Image by Sameer Samat from A pop of color and more: updates to Android’s brand (blog.google)

Android Device Bridge, abbreviated as ADB, is a versatile command line tool that lets a machine communicates with a device. It is versatile because it can perform lots of tasks. For example:

  1. Installing an app
  2. Debugging an app
  3. Uninstalling an app — It lets a user uninstall an app that can not be uninstalled by simple using a phone like google play movies, google play music etc.
  4. Copying files

It is a client-server program that has three components.

  1. Client: A client sends instructions as a command to the targeted device through a terminal or command prompt.
  2. Daemon: Daemon runs as a background process in the targeted device to perform the command.
  3. Server: Server acts as a communication medium between the client and the daemon.

How to connect a phone to a PC via ADB?

Well, the steps are pretty simple.

First, a user have to prepare the environment. This includes preparing the PC and preparing the targeted device, in this case the smartphone.

1. Preparing the PC:

1. Download the SDK platform from the official website.

Download the platform tool for your device

2. Extract the ZIP file on PC. It is necessary to extract the files on your C drive, user can extract the zip file on any drive.

Extract the ZIP file

Now PC is ready.

2. Preparing the phone:

The USB debugging option resides under the Developer option. In Android 4+ the developer option is hidden and needs to be unlocked. To unlock the developer option, you need to:

1. Go to “Settings”.

2. Go to “About Phone” or “About Device”.

About phone section

3. Scroll doe to the option “Build Number” seven times to unlock the developer option. Depending upon on your device you may need to tap “Build number”, “Software version”, “Software information”.

Tap software version 7 times

4. Type your pattern/PIN if the prompt appears.

4. Now the developer option is visible in the settings menu. Depending upon the device, it may appear under: Settings > General > Developer options or Settings > Additional settings > Developer options.

“Developer options” visible under “Additional settings”

If you can not find, simply search “Developer settings” on the search bar in settings.

5. As developer option is turned on, now scroll down to find the option “USB debugging” under “DEBUGGING” section and turn on.

Turn on “USB debugging” from here

The phone is ready now.

Connecting the devices via USB

Now, as both the phone and the machine(PC) are ready, a user just need to connect this both device via ADB.

To connect the devices, follow the below procedure.

  1. Connect the devices via USB.
  2. In the machine, head over to the folder where the SDK platform was extracted. The name of the extracted folder may look like “platform-tools_r33.0.1-windows”. Under the folder there will be another folder with name “platform-tools”, open it.
  3. In the navigation bar, type “cmd” and then press enter. It will open the windows command prompt like this:
Type “cmd” in the navigation bar

4. In the command prompt, run the command “adb devices”.

Run the command “adb devices” in the terminal

5. The command prompt dialogue box in the phone asking for permission to allow USB debugging. Tap “OK”. User may uncheck the option “Always allow from this computer”. If the user unchecks the option the device will still be connected, but every time the user tries to connect to the machine via ADB the prompt will appear.

Click “OK” in the prompt

5. After running the command, the “command prompt” show the device under “List of device attached” with the device ID.

Device connected and ready

The devices are now connected via ADB to perform various tasks including installing and uninstalling an application, copying and moving files etc.

--

--

Tell me bro

Professional content writer with engineering background. Tech-savvy, loves technology and gadgets. Geek. Nerd. Bookworm.