How to Install and Configure Android Debug Bridge (ADB) on Windows and macOS

No votes yet.
Please wait...

Android Debug Bridge (ADB) is a utility of command prompt for multi purpose that helps to get access to Android devices.

ADB allows doing the following:

  • Install, copy, and delete files;
  • Install a program on a device;
  • Record a video or take a screenshot of the phone;
  • Debug a device in case of its malfunction;
  • Examine logs on the phone;
  • Upgrade the firmware of the programs and system elements;
  • Get full access to information about OS and a device.
Android Debug Bridge

Android Debug Bridge

ADB Installation and Environment Setup for PC With macOS

To install ADB on a PC with macOS, you have to do the following:

  1. Download the app installer for macOS from the official website.
  2. Unzip the file. Move the Platforms-tools folder anywhere you need.
  3. Activate Launchpad that is in the “Other” catalog. Then open the Terminal application.
  4. Go from Terminal to Platforms-tools using the cd command.
  5. When you’re in the correct directory, you need to examine ADB performance. For this, enter the “./adb” command in the Terminal menu.
  6. If you see information about used applications in the Terminal catalog then everything functions properly.

ADB Installation and Environment Setup for PC With Windows OS

To install Android Debug Bridge on Windows, you need:

  1. Download the app installer for Windows from the official website.
  2. Extract all the files from the archive. Move the Platforms-tools folder on disk C:/.
  3. Go to Control Panel > System and Security > System. Or you can use the following key combination: Win+Pause/Break. Then go to Advanced system settings.
  4. Go to Environment variables.
  5. In System variables, you have to select Path and click on Change.
  6. Write the path to platforms-tools with adb files.
  7. Reboot the system and activate the command prompt.
  8. Enter the adb version command. You have to see info about the ADB version. It means that installation was completed properly and the program is ready for use.

Preparing Android OS for ADB Performance

To fully use all the ADB functions on Android devices, it is necessary to make certain changes in the phone settings. Depending on the manufacturer, the configuration menu may vary. But in general, the main actions are the same:

  1. Go to Settings > About phone;
  2. Keep clicking on a build number until you see a message that you’re a developer;
  3. In main settings go to the Developer options section;
  4. Click on USB debugging;
  5. Connect the device to PC via USB;
  6. Confirm the debugging via USB on the phone.

Before you start working, you have to assure that PC identified a mobile device and the whole functionality works properly. To do it on PC with Windows, you have to write “adb devices” in the command prompt.

If you work on PC with macOS, you should begin all the commands with “./”.

After this, you have to see the notification that all steps were correct and the program is ready for use. If you don’t see such a message, assure if there is an official utility driver.

The Most Common Commands in ADB

CommandFunction
adbCommand output into windows console
adb devicesDisplays information about devices connected to the PC and their serial numbers
adb rebootAndroid reboot
adb logcatCompiles and shows logs on the device. The logs are displayed in a command prompt
adb push C:\Users\user\Documents\temp.txt /sdcardAllows transferring files from PC to mobile device. For this, you have to write address for moving file and a place where it’ll be stored on the phone
adb logcat -d > ~/test.logCompiles logs from the phone and records them in another file
adb shell screenrecord /sdcard/test.mp4Records a video from the screen of a mobile device mentioning the file location, name, and extension
adb install C:\test.apkInstalls a program on a device. You just have to write a path to the utility
adb shell screencap /sdcard/test.pngTakes a screenshot of the mobile device mentioning the file location, name, and extension

To Sum Up

Android Debug Bridge is a universal tool that is very useful for a tester especially when it comes to Android devices’ performance during mobile testing.

Even though ADB’s interface isn’t so compelling, its functionality is quite huge. And this is a key to effective work with mobile devices.

Leave A Comment