The Android platform has several capabilities that can only be accessed using obscure paths and techniques. These have typically been carried out with the use of a few command line Android Debug Bridge (ADB) commands. This article will walk you through the various ways to install Android Debug Bridge on Linux, macOS, and Windows.
Google provides this tool for developers to utilize to debug various components of their applications or the system, but we can also use it for a variety of clever and covert tactics. Installing ADB on your PC is necessary for doing these hacks.
Follow this article as we shed more light on how to install Android Debug Bridge on a phone.
What is Android Debug Bridge (ADB)?
Android Debug Bridge (ADB) is a command-line utility that allows you to gain access to Android devices. The command-line tool ADB, or Android Debug Bridge, is part of Google’s Android SDK. ADB can do a lot of things, including running shell commands, copying data back and forth, installing and removing programs, and controlling your device over a USB from a computer.
You can interface with a device using the flexible command-line tool known as Android Debug Bridge (ADB). Several device tasks, like installing and troubleshooting apps, are made easier by the ADB command.
With the help of ADB, you can access a Unix shell and execute different commands on a device. There are three parts to this client-server program:
- A Client: This transmits orders. On your development computer, the client is running. An adb command can be used to launch a client from a command-line terminal.
- A Daemon (adbd): It causes a device to execute commands. For each device, the daemon operates as a background process.
- A Server: This controls how the client and daemon communicate. The server operates on your development PC in the background.
Features of Android Debug Bridge (ADB)
ADB permits the following actions:
- File installation, copying, and deletion.
- Install the software on a device.
- Take a video or a screenshot of the phone.
- If a device fails, debug it.
- Examine the phone logs.
- Update the firmware of the programs and system components.
- Get complete access to information about an operating system and a device.
Useful Android Debug Bridge Commands
ADB provides the following helpful commands in addition to the diversity of techniques that it is necessary for:
- adb install C:\ package.apk: This helps to install the package located at C:\package.apk on your computer and device with the command.
- adb uninstall package.name: The package with the specified name is removed from your device. For instance, to delete the Angry Birds app, you would use the term com.rovio.angrybirds.
- adb push C:\file /sdcard/file: uploads a file to your device via push from your computer. For instance, this command copies a file from your computer’s C: drive to your device’s /sdcard/drive.
- adb pull /sdcard/file C:\file: Obtains a file from your device and transfers it to your computer; similar to an adb push, but in reverse.
- adb logcat: See the log on your Android device. It can also be helpful for app debugging.
- adb shell: Gives you an interactive Linux command-line shell on your device.
- adb shell command: The specified shell command is executed on your device.
How Android Debug Bridge (ADB) Works
An ADB client initially determines if an ADB server process is already active when it is started. If not, it launches the server process. The server attaches to local TCP port 5037 when it first starts, where it waits for orders from ADB clients.
After that, the server establishes connections with all active devices. The first 16 emulators employ a range of odd-numbered ports between 5555 and 5585, which is how it finds the emulators. The server makes a connection to the port and finds an ADB daemon there (adbd).
Each emulator employs a set of two sequential ports, one for console connections and the other for ADB connections. For instance:
- Emulator 1, console: 5554
Emulator 1, adb: 5555
- Emulator 2, console: 5556
- Emulator 2, adb: 5557, etc.
As can be seen, the emulator that is connected to ADB on port 5555 and whose console listens on port 5554 is the same.
You can use ADB commands to access those devices once the server has established connections to each one. You can control any device from any client or a script since the server controls connections to devices and processes commands from various ADB clients.
How to Install ADB via Phone Setup
Keep in mind that setting up ADB on the computer is just half of the solution; your smartphone or tablet must also be configured to receive ADB commands. Here’s how to install Android Debug Bridge on a phone:
- Open the Settings app on your smartphone.
- Near the bottom of the list, select the About Phone option.
- The “About phone” tab on your smartphone can go by a different name or be tucked away in a different place in Settings, depending on the OEM skin.
- To activate Developer Mode, tap the Build number seven times. Once it’s finished, a toast message will appear.
- Return to the main Settings screen at this point, and you should be able to access a new Developer options menu.
- You might need to go to Settings >> System on Google Pixel phones and some other devices to access the Developer settings panel.
- Enable the USB debugging option by going there.
- The process of setting up your phone is nearly complete.
- You must then scroll down and adhere to the remaining instructions for your specific operating system.
You can follow along with your computer’s operating system.
How to Install Android Debug Bridge on a PC with macOS
Now, you can go ahead to install Android debug bridge on a PC with macOS. Follow the steps below:
- On the official website, download the Mac app installer.
- Unzip the archive. Place the Platforms-tools folder wherever you want.
- Launchpad from the “Other” catalog should be activated.
- Then, launch the Terminal program.
- Using the cd command, navigate from Terminal to Platforms-tools.
- Examine ADB performance once you are in the correct directory.
- In the Terminal menu, type “./adb” to accomplish this.
- Everything is working properly once you see the information about used applications in the Terminal catalog.
How to Install Android Debug Bridge on Microsoft Windows
To install Android Debug Bridge on Windows, you will need the following:
- Download the Windows ZIP file for the Android SDK Platform Tools.
- Extract the contents of this ZIP file to a location on your computer that is simple to access, such as C:\platform-tools.
- Once the contents of this ZIP file have been extracted, launch Windows Explorer and navigate there.
- Open a Command Prompt by selecting it in the same directory as the ADB binary.
- The shift can be held down when right-clicking a folder and selecting “Open command window here” from the menu that appears.
- Users of Windows 11 don’t even need to click on the Shift key on the keyboard to see “Open in Terminal” in the right-click context menu.
- Use a USB cord to connect your tablet or smartphone to your PC.
- Set “file transfer (MTP)” as the USB mode. For general compatibility, it’s better to just leave it in this mode, even if some OEMs might or might not require it.
- To start the ADB daemon, type the following command into the Command Prompt window: ADB devices.
- You ought to see a prompt asking if you want to grant USB Debugging access on your phone’s display.
- Naturally, when prompted, you will want to give USB Debugging access (and tap the always allow check box if you never want to see that prompt again).
- Retype the command from step 6 to finish. If all went well, the serial number of your device should now be visible in the command prompt (or the PowerShell window).
That’s it! Every ADB command can now be executed on your device!
How to Install Android Debug Bridge on Linux
Linux users can use the following Terminal command, substituting the desired folder for the destination folder to set the location of the platform-tool folder. Follow the steps below to install Android Debug Bridge on Linux:
- Download the Linux ZIP file containing the Android SDK Platform Tools.
- Extract the ZIP file to a location that is simple to reach (like the Desktop for example).
- Launch the Terminal program.
- Input the command as follows: cd/path/to/extracted/folder/.
- This command changes the directory to the location where the ADB files were extracted. For instance: cd /Users/Doug/Desktop/platform-tools.
- Use your USB cord to connect your device to your Linux computer.
- “File transfer (MTP)” mode should be selected for the connection. Although it’s not always necessary for every device, doing this is recommended to avoid problems.
- You can use the command ./adb devices to start the ADB daemon once the Terminal is in the same location as your ADB tools.
- A prompt will appear on your smartphone or tablet asking you to approve USB debugging once you return. Don’t hesitate to accept.
That’s it! Now, you have successfully installed Android Debug Bridge (ADB) on macOS, Windows, and Linux.