ADB refers to “ Android Debug Bridge”. It is the most commonly used command line tool among Android enthusiasts. It is generally used to communicate with a smartphone, set-top box, tablet, smartwatch or any other device that can run the Android operating system (including emulator).
The ADB binary has few builtin specific commands while some of them work by themselves, most are what users send to the command device. ADB allows you to perform functions on Android devices though may not be suitable for regular use, yet enhances the user experience. For instance, using ADB you can install apps outside the Play Store, access hidden features, debug apps and bring up a Unix shell and therefore give commands directly to the device. But for doing the same you have to unlock the Developer Options and enable USB Debugging mode. Besides, one is required to authorise USB Debugging access to a specific PC which is connected to the device through a USB cable.
What is ADB?
ADB is primarily a client- server program. It constitutes three components.
- Client, as it is popularly referred to by Google. Client is basically the computer your Android device is connected to. Using Client you will be able to issue commands to your Android device (connected via USB cable; in some cases even wireless)
- Daemon: it is also known as adbd. It is a service that runs on both the Android device and the PC to which it is connected. This service allows the Android device to accept and execute the commands.
- Server: It is a software that allows communication between the Client and the daemon. In detail, as you give the ADB command in a command prompt, PowerShell or a terminal, the Server running on the hindsight sends over the command to the daemon.
All these three components are very much integrated and interdependent, ensuring smooth flow of communication. On the whole, this process provides you with efficient access to your smartphone, smartwatch, tablet and others.
How Does ADB work?
Though the three components of ADB (Client, Daemon and the server) are interdependent; it is important for Daemon to be running for the process to kickstart. So if you are using a recently booted PC and you don’t have the setup ready to boot the daemon; the first step is to get the setup ready.
Infact the system checks for daemon setup and pops up a message in the command prompt or terminal regarding the status of the process.
If the daemon has not yet started it shall start the process and also mention on which local TCP port its been initiated. Once the process begins, it will listen to that specific port for commands, sent by the ADB client. Later, it shall set up connections with all running devices attached to the PC (even emulators). At this moment your Android device receives an authorization request unless your device has been connected to that PC earlier.
Examples of ADB:
ADB can be used to perform numerous functions on an Android device. While few commands are in-built in the ADB binary, some require manual command. The in-built commands in the ADB binary work on almost all Android devices. ADB Shell is used to run commands directly on an Android device. That commands that run directly on the device are device specific (as each OEMs have their own access policy with regard to ADB commands and their behaviours) and Android version specific.
The following are few commands you can issue on your devices:
- Print a list of connected devices:
adb devices
- Kill the ADB server:
adb kill-server
- Install an application:
adb install
- Set up port forwarding:
adb forward tcp:6100 tcp:7100
- Copy a file/directory from the device:
adb pull
- Copy a file/directory to the device:
adb push
- Initiate an ADB shell:
adb shell
How do I install ADB?
Phone Setup
- Go to Settings on your Android device.
- Tap on the About Phone option, which is generally at the bottom of the list (in the latest Android Oreo version it is hidden behind the “System” option).
- Now, tap on the Build Number option 7 times to enable Developer Mode. Post that, you shall see a toast message when it is done.
- Go back to the main Settings screen and there you shall be able to see a new Developer Options menu.
- Tap on the Developer Options menu and enable the USB Debugging option
- You are almost done with the Phone setup process, to finish it read further.
How to Install ADB on Windows:
- Download the ADB ZIP file for Windows.
- Extract the contents of this ZIP file into an easily accessible folder (such as C:\adb)
- Open Windows Explorer and browse to find the location of the extracted contents of this ZIP file
- Now open Command Prompt from the same directory as this ADB binary. It can be done by holding Shift and Right-clicking within the folder then click the “open command prompt here” option. (Some Windows 10 users may see “PowerShell” instead of “command prompt”.)
- Connect your Android device to a PC using a USB cable. Change the USB mode to “file transfer (MTP)” mode. Some OEMs might not require this, but it’s advisable to have this mode ON for better compatibility.
- In the Command Prompt window, enter the following command to launch the ADB daemon:
adb devices
- Now on your Android device, you shall be able to see a prompt to allow or deny USB Debugging access. To proceed further, grant USB Debugging access when requested (and tap the “always allow” check box unless you want to see that prompt again).
- Finally, re-enter the command from step #6. Provided the entire process was successful, you will see your device’s serial number in the command prompt.
- Congratulations! You can now run any ADB command on your device! Hereafter, go ahead and start modding your Android device by following our extensive list of tutorials!
How to Install ADB on MacOS:
- Download the ADB Zip file for macOS
- Move the ZIP file to an accessible location (like the Desktop for example) and extract it.
- Open Terminal window.
- Find the folder you extracted ADB into, enter the following command:
cd /path/to/extracted/folder/
- For example, on my Mac it was this:
cd /Users/Doug/Desktop/platform-tools/
- Connect your Android device to your Mac with a compatible USB cable. Change the USB mode to “file transfer (MTP)” mode. This step might not be necessary, but it’s advisable to have this mode ON for better compatibility.
- Ensure that the Terminal and your ADB tools are in the same folder. Afterwhich, execute the following command to launch the ADB daemon:
adb devices
- Now, you shall see an “Allow USB debugging” prompt. Allow the connection.
- Finally, re-enter the command from step #7. Provided the entire process was successful, you will see your device’s serial number in macOS’s Terminal window.
- Congratulations! You can now run any ADB command on your device! Hereafter, go ahead and start modding your device by following our extensive list of tutorials!
How to install ADB on Linux:
- Download the ZIP file for Linux
- Move the ZIP file to an accessible location (like the Desktop for example) and extract it.
- Open Terminal window.
- Enter the command: cd /path/to/extracted/folder/
- This command will change the directory to where you extracted the ADB files.
- So for example:cd /Users/Doug/Desktop/platform-tools/
- Connect your device to your Linux machine using a USB cable. Change the USB mode to “file transfer (MTP)” mode. This step might not be necessary, but it’s advisable to have this mode ON for better compatibility.
- Ensure that the Terminal and your ADB tools are in the same folder. Afterwhich, execute the following command to launch the ADB daemon:
adb devices
. - Now on your device, you shall see a prompt asking you to allow USB debugging. Go ahead and grant it.
- Finally, re-enter the command from step #8. Provided the entire process was successful, you will see your device’s serial number in the Terminal window output.
- Congratulations! You can now run any ADB command on your device! Hereafter, go ahead and start modding your device by following our extensive list of tutorials!
Note: Linux users should note here that the process mentioned above shall work in most cases. However, if you own a Debian or Fedora/SUSE-based distro of Linux, you can skip steps 1 and 2 of the guide above and use one of the following commands…
- Debian-based Linux users can use the following command to install ADB:
sudo apt-get install adb
- Fedora/SUSE-based Linux users can use the following command to install ADB:
sudo yum install android-tools
Syed Hammad Raza says
adb device server is outdated
Manoj says
Thank you.. Drivers are working
Riccii says
Thx this first step is working
vidnwpcrec says
thank you
khalloud says
il dosn’t work for me: this is the message :
adb : Le terme «adb» n’est pas reconnu comme nom d’applet de commande, fonction, fichier de script ou programme
exécutable. Vérifiez l’orthographe du nom, ou si un chemin d’accès existe, vérifiez que le chemin d’accès est correct
et réessayez.
Au caractère Ligne:1 : 1
+ adb devices
+ ~~~
+ CategoryInfo : ObjectNotFound: (adb:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Luís says
use cmd instead of powershell, it worked for me