Sign in to your XDA account
Quick Links
-
What is the Android Debug Bridge (ADB)?
-
How to set up ADB on your phone
-
How to set up ADB on your computer
-
Add ADB to your Path environment variables
-
WSL, ADB over Wi-Fi, and using your browser
-
What else can I do with ADB?
Most of the best phones on the market run Android, and it’s preferred by many for being a more open operating system than Apple’s iOS. However, there are many things on Android that are also hidden from the average user. Thankfully, many of these capabilities can be accessed by using the Android Debug Bridge (ADB). If you’re wondering how to set it up, we’re here to help with that.
Related
These are 5 features I want Android 15 to bring, because Android updates are getting boring
Android 15 is a few months out, but there are still some features we could see, especially Pixel-exclusive features.
What is the Android Debug Bridge (ADB)?
And how does it work?
ADB is a tool provided by Google for developers to debug and test their software on Android phones. It provides access to certain features that aren’t available to regular users, and since anyone can technically use ADB, you have a way to use these advanced features even if you’re not a developer.
The internal structure of ADB is based on the classic client-server architecture. There are three components that make up the entire process.
- The client, i.e. the PC/Mac/Chromebook you have connected to your Android device. We are sending commands to our device from the computer through the USB cable or wirelessly.
- A daemon (known as «adbd») that runs commands on an Android phone. The daemon runs as a background process on each device.
- A server that manages communication between the client and the daemon. The server runs as a background process on the computer.
Because there are three pieces that make up ADB (the client, the daemon, and the server), certain pieces need to be up and running in the first place. If you have freshly booted the computer (and you don’t have it set up to start the daemon on boot), then you will need it to be running before any communication can be sent to the target Android device.
How to set up ADB on your phone
Preparing to communicate with your computer
Setting up ADB requires some preparation on both the Android phone and the PC you want to use. For starters, follow these steps on your phone:
- Launch the Settings application on your phone.
-
Tap the About phone option generally near the bottom of the list.
Depending on the OEM skin, the About phone page may be called something else or buried somewhere else in the Settings app on your device.
- Then tap the Build number option seven times to enable Developer Mode. You will see a toast message when it is done.
-
Now go back to the main Settings screen, and you should see a new Developer options menu you can access.
On Google Pixel phones and some other devices, you might need to navigate to Settings > System to find the Developer options menu.
- Go in there and enable the USB debugging option.
For now, you’re done with the process on the phone. Next up, you will need to scroll below and follow the rest of the instructions for your particular operating system.
How to set up ADB on your computer
How to set up ADB on Microsoft Windows
- Download the Android SDK Platform Tools ZIP file for Windows.
- Extract the contents of this ZIP file into an easily accessible folder (such as C:\platform-tools).
- Open File Explorer and browse to where you extracted the contents of this ZIP file.
-
Right-click an empty area of the File Explorer window and choose Open in Terminal. If you have an older version of Windows without Windows Terminal, you need to hold Shift on the keyboard while right-clicking, then choose Open PowerShell window here.
- Connect your smartphone or tablet to your computer with a USB cable. Change the USB mode to “file transfer (MTP)” mode. Some OEMs may or may not require this, but it’s best to just leave it in this mode for general compatibility.
-
In the PowerShell/Terminal window, enter the following command to launch the ADB daemon.
./adb devices
-
On your phone’s screen, you should see a prompt to allow or deny USB Debugging access. Tap Allow.
-
Finally, re-enter the command from step 6. If everything was successful, you should now see your device’s serial number in the command prompt/Terminal window.
You can now run any ADB command on your device! As a side note, you can also isntall adb using a package manager like winget, which makes it easier to keep adb updated.
How to set up ADB on macOS
- Download the Android SDK Platform Tools ZIP file for macOS.
- Extract the ZIP to an easily accessible location (like the Desktop, for example).
- Open Terminal.
-
To browse to the folder you extracted ADB into, enter the following command, where path/to/extracted/folder represents the folder where you extracted the ZIP file to.:
cd /path/to/extracted/folder/
For example, if you extracted them to your desktop, the command would look like this:
cd /Users/XDA/Desktop/platform-tools/
- Connect your device to your Mac with a compatible USB cable. Change the USB connection mode to “file transfer (MTP)” mode. This is not always required for every device, but it’s best to just leave it in this mode, so you don’t run into any issues.
-
Once the Terminal is in the same folder your ADB tools are in, you can execute the following command to launch the ADB daemon:
./adb devices
-
On your phone, you’ll see an Allow USB debugging prompt. Allow the connection.
-
Finally, re-enter the command from step 7. If everything was successful, you should now see your device’s serial number in macOS’s Terminal window.
Congratulations! You can now run any ADB command on your device!
While the guide above will certainly work, veteran macOS users can also opt to install ADB on their Macs using an unofficial package manager such as Homebrew or MacPorts. That way, you don’t have to manually update the binaries.
How to set up ADB on Linux
- Download the Android SDK Platform Tools ZIP file for Linux.
- Extract the ZIP to an easily accessible location (like the Desktop, for example).
- Open a Terminal window.
-
Browse to the extracted folder using the following command, replacing path/to/extracted/folder with the folder where you extracted the ZIP file to:
cd /path/to/extracted/folder/
For example:
cd /home/XDA/Desktop/platform-tools/
- Connect your device to your Linux machine with your USB cable. Change the connection mode to file transfer (MTP) mode. This is not always necessary for every device, but it’s recommended, so you don’t run into any issues.
-
Once the Terminal is in the same folder your ADB tools are in, you can execute the following command to launch the ADB daemon:
./adb devices
-
Back on your Android device, you’ll see a prompt asking you to allow USB debugging. Go ahead and grant it.
-
Finally, re-enter the command from step 8. If everything was successful, you should now see your device’s serial number in the Terminal window output.
Congrats! You can now run any ADB command on your device!
Linux users should know that there is an easier way to install ADB on their computers. The guide above will certainly work for you, but those who own a mainstream Debian/Ubuntu or Fedora/SUSE-based distro of Linux can skip steps 1 and 2 of the guide above and use one of the following commands:
-
Debian/Ubuntu-based Linux users can type the following command to install ADB:
sudo apt-get install android-sdk-platform-tools
-
Fedora/SUSE-based Linux users can type the following command to install ADB:
sudo dnf install android-tools
However, it is always better to opt for the latest binary from the Android SDK Platform Tools release since the distro-specific packages often contain outdated builds.
Add ADB to your Path environment variables
You can use ADB just fine through the steps above, but if you’re doing this frequently, adding ADB to the PATH environment variable is a huge time saver. All major operating systems have a PATH variable, and it allows you to specify the location of important programs that are also trusted by the user, so the computer can automatically access it without ahving to open the program’s location first. For instance, you can type «calc» in the Run prompt of Windows to launch calculator, but not «chrome» to start Google Chrome — simply because the location of the latter isn’t included in the PATH variable.
Adding ADB to the PATH environment variable allows you to run ADB by running the terminal normally, and it also makes it so you don’t need to precede ADB commands with ./ . Here’s how to do it.
Windows
-
Right-click on the Start button (or use the Windows + X keyboard shortcut) and select the System option. You will be greeted with a screen showing some system information.
-
Select Advanced system settings from the Related links section under Device specifications.
-
Click on the Environment Variables button.
-
Look for the variable named Path under System variables and double-click it.
-
Click New, then Browse and navigate to the folder where you extracted the ADB files (e.g. C:\platform-tools).
- When you see the folder location is properly listed, click the OK button out of all the Windows you have opened to confirm.
- Sometimes, the graphical shell needs a restart to make the changes take effect. You can simply sign out and sign in again or reboot your PC to force Windows to use the updated PATH settings.
Now start a new terminal or command prompt instance and type adb to verify the location has been added.
In case you use a package manager like Chocolatey to install ADB, it should take care of the PATH variable editing portion as well. As a result, you can skip the above process.
macOS
You can use the following steps to set up the PATH environment variable in macOS, but if you installed ADB using a package manager like Homebrew, this is unnecessary. Here’s how it works:
- Note down the location where you extracted the ADB tools.
-
Open the Terminal app and make sure to be in the Home directory.
cd ~
-
In case you’re running any macOS version older than Catalina, the default shell should be Bash. For macOS Catalina and newer, the default changed to the Z shell (Zsh). Hence, you need to determine the current shell before changing the PATH variable. Type the following command and press Enter to see the shell your Mac is using:
echo $0
-
Depending on the output, create a shell configuration file. For Bash:
touch .bash_profile
For Zsh:
touch .zshrc
People who are already using custom shell configurations can skip this step.
-
Open the shell configuration file with TextEdit: For Bash:
open -e .bash_profile
For Zsh:
open -e .zshrc
If you prefer to use nano/pico/vi or any other CLI text editor, you can instead.
-
Adjust the location according to the first step in the following command and add it to the shell configuration file you just opened:
export PATH=$PATH:/path/to/extracted/folder/
For example:
export PATH=$PATH:/Users/XDA/Desktop/platform-tools/
-
Save the file and close the TextEdit app. Next, go back to the Terminal app and reload your shell settings. For Bash:
source .bash_profile
For Zsh:
source .zshrc
-
You’re done. Optionally, verify the PATH variable assertions using the following command:
echo $PATH
To test if the process was successful, start a new Terminal instance and type adb. You can also install adb with Homebrew, which will automatically add it to your PATH!
Linux
- Note down the location where you extracted the ADB tools.
-
Open the Terminal app and make sure to be in the Home directory.
cd ~
- Due to the fact that most common Linux distributions ship with Bash as their default shell, the next steps will be Bash-specific. You can, of course, consult the documentation of your preferred shell and modify the commands to suit your needs.
-
Open the shell configuration file with a text editor:
sudo nano .bashrc
You can also use other editors like vi or gedit.
-
Add the following line to the end of the .bashrc file. Remember to adjust the location according to the first step beforehand.
export PATH=$PATH:/path/to/extracted/folder/
For example:
export PATH=$PATH:/home/xda/platform-tools/
Be careful editing this file; do not add anything else or change anything else.
-
Save the file. Next, go back to the Terminal app and reload your shell settings:
source ~/.bashrc
-
Optionally, verify the PATH variable assertions using the following command:
echo $PATH
Now you can call ADB from anywhere under Linux. To check if it’s working, spawn a new Terminal window and type adb.
It is worth mentioning that you don’t need to perform these steps if you prefer to install (and update) ADB using the distro-specific packages.
WSL, ADB over Wi-Fi, and using your browser
How to set up ADB on Windows Subsystem for Linux and ChromeOS
Windows Subsystem for Linux (WSL) offers Windows users a seamless way to run Linux apps. However, the environment has yet to offer full-fledged USB hardware access. As a consequence, ADB under WSL can’t access your Android device, even if you install it using the aforementioned way. Nonetheless, there exists an official workaround, which utilizes the open-source usbipd-win project. To know more, take a look at our tutorial on how to set up USB passthrough in WSL.
For ChromeOS, you need to turn on the built-in Linux development environment first. By default, it offers you a Debian instance. You can then easily set up ADB using the Linux-oriented steps mentioned earlier.
Just to cover all of our bases here, users may need to put a ./ in front of any ADB commands you use in the future, especially when they are using the extracted binaries directly from the Google-provided Platform Tools ZIP. This is something any *nix user (or Windows user running PowerShell/Terminal) will likely know, but it’s important to remember.
How to set up ADB on your browser
The ADB protocol can be implemented using the WebUSB API in order to control Android phones directly from web browsers. Tango (formerly known as Yet Another WebADB) is one such project that allows users to perform most of the functionality provided by ADB right from the web browser without installing any binary. All you need is a web browser that supports the WebUSB API (such as Google Chrome, Microsoft Edge, or Firefox) and you are good to go. It’s worth noting that some browsers, such as Vivaldi, don’t properly display the popup for USB device connections, so they may not work for this.
How to use ADB over Wi-Fi
Android 11 and higher editions natively support ADB connection over Wi-Fi. This eliminates the need to deal with common USB connection issues and additional steps, such as Android OEM driver installation on Windows.
In order to set up wireless debugging, do the following:
- Make sure that your PC/Mac and the phone are connected to the same wireless network.
-
On your phone, go to Developer options under Settings and enable Wireless debugging. On the Allow wireless debugging on this network? popup, select Allow.
-
Tap on the Wireless debugging option and select Pair device with pairing code.
-
Take note of the pairing code, IP address, and port number displayed on the phone screen.
-
On your PC/Mac, run the following command:
adb pair IP_Address:Port
Use the IP address and port number from step 4.
- When prompted, enter the pairing code that you received in step 4. A message should indicate that your device has been successfully paired.
-
Next, run the following command on the PC/Mac’s terminal window:
adb connect IP_Address:Port
Look at the IP address & Port section under Wireless debugging in step 3 for the IP address and port.
-
If everything goes right, then you should see a message like the following:
connected to 192.168.68.100:37173
- Now you’re ready to type whatever ADB shell command you want.
Examples of ADB commands
To check if you have successfully installed ADB, connect your device to your PC/Mac with your USB cable, and run the adb devices command as described above. It should display your device listed in the Command Prompt/PowerShell/Terminal window. If you get a different output, we recommend starting over with the steps.
As mentioned above, you can use ADB to do all sorts of things on an Android device. Some of these commands are built directly into the ADB binary and should work on all devices. You can also open up what is referred to as an ADB Shell that will let you run commands directly on the device. The commands which are run directly on the device can vary from device to device (since OEMs can remove access to certain ones, and also modify ADB behavior) and can vary from one version of Android to the next as well.
Below, you’ll find a list of example commands which you can do on your device:
-
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
What else can I do with ADB?
Below is a list of XDA tutorials for various devices that detail many applications of ADB commands in order to modify hidden settings, customize OEM features or user interfaces, and much more!
Related
How to boot into recovery mode using button combos, ADB, and root apps
If you have an Android or iOS device and are wondering how to boot into recovery to clear cache or reset your device, this is how to do it!
Related
How to uninstall carrier/OEM bloatware without root access
If you want to get rid of carrier/OEM apps from your phone, here’s how you can uninstall bloatware from your device without root access!
Related
How to debloat your phone (and more) without connecting to a PC
LADB is an app that lets you run ADB shell commands from your phone, no root and no PC needed! Use it to debloat your phone and more!
Related
How to sideload apps on Android TV: APK Install and ADB Sideload methods explained in easy-to-follow steps!
Not sure how to sideload apps on Android TV? We explain two easy ways to sideload APKs or Android app bundles on Android TV devices.
Related
Control your Android Smartphone from your PC for free with scrcpy
A new tool called «scrcpy» allows you to display your phone screen on your computer with just a USB connection and ADB. No root required.
Related
ADB tips and tricks: Commands that every power user should know about
There’s a lot to the Android Debug Bridge that you may not know about. Click here for some useful tips and tricks for using ADB!
This tutorial will help you easily install ADB and launch it on your Windows, Linux, or macOS machine.
What is ADB? – Android Debug Bridge is a command-line tool that has been a part of Android SDK and development tools for a long long time. The tool allows your PC to communicate with your Android device and perform several actions. Some common adb commands include adb devices, adb reboot, etc. We will come to them later in this article.
A list of few tutorials that require you to install ADB and Fastboot on your PC:
- How to Increase Galaxy Edge Screen Size without Root
- How to Install Custom Themes on Android Oreo without Root
- Get ‘Turn on Wi-Fi Automatically’ Option for Nexus 6P/5X on Android Oreo
- How to Change Android SMS Limit without Root
- Find If Project Treble Supports Your Android Oreo Device
Page Contents
- Install ADB on Windows, Linux, and macOS
- Make Your Android Device Ready
- Install ADB on Windows
- Install ADB on Linux
- Install ADB on macOS
When we or most other out there say that “You need to install ADB on your PC“, we generally mean all the major platform tools that are part of the Android SDK. However, we consider ADB for the fact that it is one of the tools that is of paramount importance, not only for developers but also for advanced users who would want to tweak their Android. So that’s what we are here for. To help you install ADB and Fastboot, or install Android SDK tools or setup platform tools, you may call it by different ways, but the process that follows is the same all around.
Now, to install ADB on your computer is just the first half of the story. The next chunk is to be carried on your Android device to make it work. Rubbish? No. It is equally important to adjust the settings on your device to make the connection successful between the PC and device. So we will have it all covered below.
Make Your Android Device Ready
In order to install ADB and use it, your device must first have the USB debugging option enabled. If you already have it or know how to do it, then you may skip this section and move on to the next.
- Go to the device ‘Settings’ and scroll down until you see ‘About phone’ (Up to Android 7.0 Nougat) or ‘System’ -> ‘About Phone’ (Android 8.0 Oreo or above).
- Find the “Build number” field and start tapping on it continuously for 7 times until you see the “You are now a developer!” toast notification on the screen.
- Now go back to settings and access “Developer options”. On Android Oreo and above, you will find it in ‘Settings’ -> ‘System’.
- Scroll down until you find the “USB debugging” option and switch ON the toggle. When prompted, select “OK“.
- That’s it, you have just enabled USB debugging on your Android. Now head over to install ADB and establish a connection between your device and PC.
Install ADB on Windows
- Download the platform-tools package for Windows: Link
- We are going to need a location on the PC where the files could remain untouched, yet easily accessible. So extract the content of the downloaded “platform-tools-latest-windows.zip” file to C:\adb.
- So when you view this folder, you will see something like in the image above.
- Go to the folder where the files are present (Example: C:\adb).
- On an empty space inside this folder, press the SHIFT key and right-click. Select “Open command window here” or “Open PowerShell window here” from the menu that appears.
- Now, connect your Android device to the PC using USB cable and enter the following command to initiate the ADB connection.
adb devices
- Just as you enter the command, your phone will be prompted by a message to allow a USB debugging connection.
- Also, during this time, the command prompt will return the device serial number with “unauthorized” message. Once you agree to the prompt, you are good to go. You may also select the “Always allow from this computer” option so that you will not have to go through this process again.
- Finally, you should enter the “adb devices” command again and you will have instant ADB connection between your PC and device.
You have now been able to install ADB on Windows PC and have also established a successful connection between your PC and device.
Install ADB on Linux
- Download the platform tools package for Linux: Link
- Extract the content of the downloaded “platform-tools-latest-linux.zip” file to a suitable location of your choice. We prefer the Desktop.
- So open a Terminal window and direct it to the folder where the ADB and other binaries are present.
cd /location/to/the/folder/
- Example:
cd /Desktop/adb/
- Now connect your Android device to the PC via USB cable and enter the following command in the Terminal window:
./adb devices
- The first time you enter this command, the Terminal window will return the device serial along with the “unauthorized” message.
- You shall also instantly see a message prompt on your device screen asking to allow USB debugging connection with the PC. So just allow it.
- Finally, enter the “./adb devices” command again and you will be able to establish a successful connection between your PC and device over ADB.
You have now been able to install ADB on Linux.
Install ADB on macOS
- Download the platform tools package for macOS: Link
- Extract the content of the downloaded “platform-tools-latest-darwin.zip” file to an easily accessible location on your PC, inside a folder named “adb” (For ease of access).
- We prefer to have it on Desktop. So now, all the platform tools package content i.e. the binaries will be present in “/Desktop/adb/”.
- Go to the Launchpad and open Terminal.
- You will now need to direct it to the location where ADB and other binary files are present. So enter the following command:
cd /location/to/the/folder/
- Example:
cd /Desktop/adb/
- Now that your Terminal is directed to use this location, you can connect your device to the PC via USB cable.
- Enter the following command to initiate an ADB connection with your Android device.
./adb devices
- As soon as you enter the command, the device will be prompted with a message to allow USB debugging. The Terminal will also display the device serial along with an “unauthorized” message.
- So agree to the message and allow the connection. Then enter the “adb devices” command again to have a successful connection between your PC and device over ADB.
There you go! You have been successful to install ADB on macOS. Now that you’re done with installing, follow our tutorial on how to use ADB and Fastboot from any directory on your PC.
We make use of ADB and Fastboot in a lot of our day-to-day tutorials. So if the next time there is one that requires this, then you will already have your device and PC ready for the job.
You may now proceed to use other commands as well. If you want to get yourself familiar with other ADB commands, kindly read the documentation. That’s it, you have been successful to install ADB on your Windows, macOS, or Linux PC. You also have your device now having a perfect connection with your PC over ADB.
Was it helpful? Let us know through the comments.
Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it.
He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.
Android Debugging Bridge (ADB), as the name suggests, is a command-line utility that allows developers to debug various parts of their applications. However, it is not restricted to just developers. If you want to access certain features of the Android platform that are not otherwise accessible, you too can use the ADB commands by installing ADB on your computer, be it Windows, macOS, Linux, or Chrome OS. Once you install it, there are numerous cool things that you can do with ADB on your Android device. Plus, there are various apps that require ADB permissions to work. So, if you have been confused about how to install and use ADB on Windows, macOS, Linux or Chrome OS, we have you covered.
Setup Your Android Device for ADB
Even if you install ADB on your computer, it is of no use unless you set up your Android device first to work with ADB. So in case you are not sure how to do that, follow the steps below to find out.
- Open Settings on your Android device, and go to “About Phone”. Here, tap on “Build number” 7 times consecutively. Keep in mind, as Android devices have different skin, the ‘Build Numer’ page may be kept under some other pages.
- This will enable “Developer options” on your Android device. Head over to “System” and then open Developer Options and enable “USB debugging”. Now, whenever you will connect your Android device to the computer, select the “File transfer (MTP)” mode. You are done on the device front. Now, the next step is to set up ADB on your computer.
- Firstly, download the ADB Platform Tools for Windows from Google’s official page. Once downloaded, extract the contents of this file on your Windows PC using a file archiver utility like WinRAR.
- Now head over to the extracted folder, and click on the address bar. Now, type “cmd” and hit enter. Instantly, a command prompt window will open up in the ADB directory.
- After that, connect your Android device to Windows PC and execute
adb devices
command.
- It will prompt a “USB debugging” prompt on your smartphone. Enable the “Always allow” checkbox and then tap on “Allow”.
- Now, you should see your device’s serial number in the Command Prompt window. If it does not detect your device then run
adb devices
again and this time, it will definitely detect your device. Congratulations! ADB is now successfully installed on your Windows PC.
Install ADB on macOS
Here, we will take a slightly different path to install ADB on macOS. We will have to install Homebrew first on macOS and then we can install the Android platform-tools easily. Homebrew is an open-source package manager that installs the missing packages. So with all that said, here we begin.
- First of all, open the Terminal on your Mac and execute the below command. It will install Homebrew on your Mac. During the installation, it might ask for your password. The whole installation will take about 10 mins.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- After that, install the ADB platform-tools from the below command.
brew install android-platform-tools --cask
- Now connect the Android device to your Mac and execute the
adb devices
command. You will receive a prompt on your Android device to allow USB debugging. So, just enable the checkbox and tap on “Allow”.
- You should now see the serial number of your device on Mac This signifies that ADB is successfully installed on your Mac.
Install ADB on Linux
- Download the ADB Platform Tools for Linux from Google’s official page and unzip the file to a suitable location like your home directory.
- After that, open the Linux terminal and move to the extracted folder location. Execute the below command to move to the particular folder. Make sure to change the username to your actual Linux username.
cd /home/arjun/platform-tools
- Connect your Android device and run the
adb devices
command on the Linux terminal. On your Android device, check the box for “Always allow” and then tap on the “Ok” button.
- Finally, your Android device will show up on the Linux Terminal with the serial number. This is how you can install and set up ADB on Linux systems.
Install ADB on Chrome OS
Before I move forward, let me clarify that your Chromebook should have Play Store support; Chrome OS should be on the Developer Channel and have Linux enabled on your machine. To move to Developer Channel, open Settings -> About Chrome OS -> Additional Details -> Change Channel to Dev. Now having said all of that, let’s learn how to install ADB on Chrome OS.
- First off, open Settings and navigate to Linux -> Develop Android Apps -> Enable the toggle for ADB Debugging. Now, restart your Chromebook and an ADB prompt will come up after the reboot. Click on “Allow” and move to the next step.
- Now, open the Linux Terminal from the app drawer and execute the below command to install the ADB platform tools. Further, press “Y” to allow the installation.
sudo apt-get install android-tools-adb
- After the installation, connect your Android device to Chromebook. You will get a prompt on your Chromebook about a USB device detection. Now, click on “Connect to Linux”.
- Back to Linux Terminal, execute the
adb devices
command and a prompt will appear on your Android device. Enable the checkbox for “Always allow” and then tap on the “Ok” button. Congratulations, you have successfully set up ADB on Chrome OS.
- If the Terminal shows “Permission Denied” or “Command Not Found” error then run the
adb start-server
command first and then try again with theadb devices
command.
How to Use ADB on Windows, macOS, Linux and Chrome OS
After you have successfully installed ADB on your Windows PC, Mac, Linux system or Chromebook, using it is just a matter of executing various ADB commands in the Terminal. Just make sure that you have connected your Android device to your computer while USB debugging is enabled. After this, you can try different commands and experience Android a whole lot differently. To help you get started, given below are a few of the most commonly used ADB commands.
Install ADB on Windows, macOS, Linux and Chrome OS With Ease
ADB is a very useful utility for all Android programmers. Even if you are not one yourself, you now know how to set up ADB on your PC or Mac and use it with your Android device. And if you’re new to this, I’ve already listed some of the common ADB commands above. This allows you to experience Android like never before. Talking about ADB commands, which ones are your favorites? I would love to hear from you in the comments section below.
ADB_How-to-Install-ADB-on-Windows-Linux-and-macOS
What is ADB? – Android Debug Bridge is a command-line tool that has been a part of Android SDK and development tools for a long long time. The tool allows your PC to communicate with your Android device and perform several actions. Some common adb commands include adb devices, adb reboot, etc. We will come to them later in this article.
Install ADB on Windows, Linux, and macOS
When we or most other out there say that “You need to install ADB on your PC“, we generally mean all the major platform tools that are part of the Android SDK. However, we consider ADB for the fact that it is one of the tools that is of paramount importance, not only for developers but also for advanced users who would want to tweak their Android. So that’s what we are here for. To help you install ADB and Fastboot, or install Android SDK tools or setup platform tools, you may call it by different ways, but the process that follows is the same all around.
Now, to install ADB on your computer is just the first half of the story. The next chunk is to be carried on your Android device to make it work. Rubbish? No. It is equally important to adjust the settings on your device to make the connection successful between the PC and device. So we will have it all covered below.
Make Your Android Device Ready
In order to install ADB and use it, your device must first have the USB debugging option enabled. If you already have it or know how to do it, then you may skip this section and move on to the next.
Go to the device ‘Settings’ and scroll down until you see ‘About phone’ (Up to Android 7.0 Nougat) or ‘System’ -> ‘About Phone’ (Android 8.0 Oreo or above).
Enable USB Debugging Android
Find the “Build number” field and start tapping on it continuously for 7 times until you see the “You are now a developer!” toast notification on the screen.
Now go back to settings and access “Developer options”. On Android Oreo and above, you will find it in ‘Settings’ -> ‘System’.
Scroll down until you find the “USB debugging” option and switch ON the toggle. When prompted, select “OK“.
USB Debugging
That’s it, you have just enabled USB debugging on your Android. Now head over to install ADB and establish a connection between your device and PC.
Install ADB on Windows
Download the platform-tools package for Windows: Link
We are going to need a location on the PC where the files could remain untouched, yet easily accessible. So extract the content of the downloaded “platform-tools-latest-windows.zip” file to C:\adb.
Install ADB on Windows — Files
So when you view this folder, you will see something like in the image above.
Go to the folder where the files are present (Example: C:\adb).
On an empty space inside this folder, press the SHIFT key and right-click. Select “Open command window here” or “Open PowerShell window here” from the menu that appears.
Open PowerShell on Windows
Now, connect your Android device to the PC using USB cable and enter the following command to initiate the ADB connection.
adb devices
Just as you enter the command, your phone will be prompted by a message to allow a USB debugging connection.Allow USB debugging Android
Also, during this time, the command prompt will return the device serial number with “unauthorized” message. Once you agree to the prompt, you are good to go. You may also select the “Always allow from this computer” option so that you will not have to go through this process again.
Finally, you should enter the “adb devices” command again and you will have instant ADB connection between your PC and device.
You have now been able to install ADB on Windows PC and have also established a successful connection between your PC and device.
Install ADB on Linux
Download the platform tools package for Linux: Link
Extract the content of the downloaded “platform-tools-latest-linux.zip” file to a suitable location of your choice. We prefer the Desktop.
So open a Terminal window and direct it to the folder where the ADB and other binaries are present.
cd /location/to/the/folder/
Example:
cd /Desktop/adb/
Now connect your Android device to the PC via USB cable and enter the following command in the Terminal window:
./adb devices
The first time you enter this command, the Terminal window will return the device serial along with the “unauthorized” message.
Allow USB debugging Android
You shall also instantly see a message prompt on your device screen asking to allow USB debugging connection with the PC. So just allow it.
Finally, enter the “./adb devices” command again and you will be able to establish a successful connection between your PC and device over ADB.
You have now been able to install ADB on Linux.
Install ADB on macOS
Download the platform tools package for macOS: Link
Extract the content of the downloaded “platform-tools-latest-darwin.zip” file to an easily accessible location on your PC, inside a folder named “adb” (For ease of access).
We prefer to have it on Desktop. So now, all the platform tools package content i.e. the binaries will be present in “/Desktop/adb/”.
Go to the Launchpad and open Terminal.
You will now need to direct it to the location where ADB and other binary files are present. So enter the following command:
cd /location/to/the/folder/
Example:
cd /Desktop/adb/
Now that your Terminal is directed to use this location, you can connect your device to the PC via USB cable.
Enter the following command to initiate an ADB connection with your Android device.
./adb devices
As soon as you enter the command, the device will be prompted with a message to allow USB debugging. The Terminal will also display the device serial along with an “unauthorized” message.
Allow USB debugging Android
So agree to the message and allow the connection. Then enter the “adb devices” command again to have a successful connection between your PC and device over ADB.
There you go! You have been successful to install ADB on macOS. Now that you’re done with installing, follow our tutorial on how to use ADB and Fastboot from any directory on your PC.
We make use of ADB and Fastboot in a lot of our day-to-day tutorials. So if the next time there is one that requires this, then you will already have your device and PC ready for the job.
You may now proceed to use other commands as well. If you want to get yourself familiar with other ADB commands, kindly read the documentation. That’s it, you have been successful to install ADB on your Windows, macOS, or Linux PC. You also have your device now having a perfect connection with your PC over ADB.
Was it helpful? Let us know through the comments.
ADB (Android Debugging Bridge) and Fastboot are used to perform valuable and critical functions on Android phones via terminal commands. Both tools are super handy in the development of the Android operating system. It also allows you to access and modify the underlying architecture of the Android operating system. ADB is usually used to send developer commands to your phone. For example, you can use it to flash updates.
Meanwhile, Fastboot can be used to send commands to the bootloader. It will allow you to flash custom firmware, factory images, and custom recoveries. This guide will elaborate on how to install ADB on Windows, Mac, or Linux operating systems along with Fastboot.
So, what’s the need to install ADB and Fastboot on your computer to perform different Android phone features? Well, without ADB and fastboot, you would need the whole Android SDK that takes about 2 GBs on your computer.
Now let’s move on to the guide on installing ADB on Windows, Mac or Linux. Each operating system has different commands. So I will cover each of them.
Prerequisites:
First of all, you need to download the zip files for ADB and Fastboot utilities. According to your Operating System, download the zip file on your computer:
- Windows
- macOS
- Linux
Once downloaded, extract the zip file where you want to use ADB and fastboot services.
- First of all, download SDK platform tools for Windows from above.
- Then, extract them somewhere easy to access.
- Now, to test whether ADB services are working correctly, we will have to connect the phone to the computer and run a command.
- Enable the USB Debugging Mode on your phone: Go to Settings > About phone> Tap Build Number seven times to enable Developer Options. Then, go to Settings > Developer Options > Enable USB Debugging.
- Now, on your computer, open the command prompt in the same folder where you extracted the zip file’s contents. In order to open the command prompt:
- Press ALT + D
- Write CMD
- Press Enter
- Make sure your phone is connected to the computer using a data cable. Also, the USB mode should be “File Transfer (MTP).”
- Now enter the following command in the terminal on your computer:
-
adb devices
-
- On your phone, allow USB debugging when a prompt comes.
- Now, you will see your phone is connected via the terminal.
If it does not work, you might have to set Environment Variable
Follow the steps below to set the environment variable:
- Go to the Control Panel of your computer and click on System and Security.
- Then click on System and select Advanced System Settings.
- Click on Environment Variables.
- Under System Variables, highlight the path, then click edit
- Click on new and add the destination location directory (Link to the directory where you installed ADB and fastboot. For example: c:\desktop\adb
- Click OK.
Install ADB and Fastboot on macOS:
- First of all, download the SDK toolkit from above.
- While extracting the files from the zip file manually, indicate you want the files extracted to the directory ~/adb
- Now, in the ADB folder, edit the file ~/.bash_profile
- Add this to the end of the file: export PATH=$PATH:~/adb
- Ensure the ADB and fastboot files in ~/adb have to execute permissions.
You can test if the ADB connection works by connecting your Android phone to your computer via a data cable and, As mentioned in the first guide, enabling USB debugging mode on your phone. Once your phone is connected, USB debugging is enabled. Next, open the terminal in the folder where you have extracted the ZIP file’s contents and enter the following command.
adb devices
Install fastboot and ADB on Linux:
- For the Linux operating system, the process is the same. First, download the ADB and fastboot utilities from above for Linux.
- Then, while extracting the files from the zip file, manually indicate you want the files extracted to the directory ~/adb
- Open the folder where you have extracted the zip file.
- In the folder, find and edit the file ~/.bash_profile
- Add this to the end of the file: export PATH=$PATH:~/adb
- Moreover, ensure that the ADB and fastboot files in ~/adb have to execute permissions.
Once you install and extract ADB files, you can connect your phone to your computer and test if the ADB connection is working with ADB commands. Once the connection is established. You can now use ADB and fastboot to install custom recoveries, flash firmware, flash factory images, or OTAs on Android smartphones like Google Pixel and Samsung.
Suppose you have questions about installing ADB on Windows, Mac, or Linux operating systems. Then, you can drop your questions in the comments below.