If you want to execute some specific commands that are difficult or impossible from the Android device itself, you can choose to install ADB on Windows, macOS or Linux and run ADB commands. In this post, NewsPivot gives you a step-by-step guide on the ADB setup.
Overview of ADB
ADB, short for Android Debug Bridge, is a command-line utility that enables developers to debug apps. However, it is not limited to just developers. If you need to access some certain features in your Android device, ADB is fairly helpful since it can be used to communicate with Android devices from a computer to execute specific commands that are hard or impossible from the device itself.
To be specific, you can move files between a PC and Android device, install APK (Android app installation packages), run shell commands, take screenshots, and more.
In order to run ADB commands, it is necessary to install ADB on your computer, whether it is Windows, macOS, Linux or Chrome OS. Next, let’s explore on how to set up ADB.
Set up Android Device
Before installing ADB on a PC, you should make some preparatory work – set up your Android device for ADB. Here we take an Android phone as an example. Note that the steps vary depending on your phone.
Step 1: Go to Settings > About phone.
Step 2: Tap on Build number 7 times continuously to enable the developer mode.
Step 3: Go back to Settings to locate Developer options and enable USB debugging.
Next, follow the instructions below as per your PC system to install ADB.
Related post: Google Chat Download & Install for Windows
ADB Download Windows 10/11 & Install
Step 1: Firstly, go to Android developers’ website to download SDK Platform-Tools for Windows.
Step 2: Extract all the contents from the .zip folder to a folder like platform-tools on the desktop.
Step 3: In the folder, press Shift and right-click on the blank space, then choose Open PowerShell window here. Alternatively, you can type cmd to the address bar in the extracted folder and press Enter. Then, PowerShell or Command Prompt could open.
Step 4: Connect your Android device to a computer, type adb devices to the CMD window, and press Enter.
Step 5: When prompted by a popup that asks you to allow USB debugging access, tap on Allow. You can check the box of Always allow from this computer.
Step 6: You can see your device’s serial number. If CMD doesn’t show it, run the command in Step 4 again.
ADB Install Mac & Linux
Step 1: Go to download SDK Platform-Tools for Mac/Linux.
Step 2: Extract the ZIP file to an accessible location.
Step 3: Open Terminal and enter the command: cd /path/platform-tools. Replace the path with your extracted folder.
Step 4: Connect a device to the Mac, run ./adb devices and allow USB debugging.
See Also: Top 4 Ways to Uninstall PowerShell Windows 10/11
Common ADB Commands
After you download ADB for Windows/macOS/Linux and install it on the PC, you can run some ADB commands as per your needs:
adb install path_to_apk: install an app using the APK file
adb pull remote local: copy a file or directory and its sub-directories from the device
adb push local remote: copy a file or directory and its sub-directories to the device
adb kill-server: stop the adb server
adb forward tcp:6100 tcp:7100: set up forwarding of host port 6100 to device port 7100
To know more commands, refer to this help document.