How to install ADB on Windows, macOS, and Linux use this one
How to install ADB on Windows, macOS, and Linux use this one
27
4
QUICK LINKS
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.
R E L ATE D
These are 5 features I want Android 15 to bring, because Android
updates are getting boring
What
Link copiedis the Android Debug Bridge (ADB)?
to clipboard
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.
1. 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.
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.
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:
2. Tap the About phone option generally near the bottom of the list.
Link copied to clipboard
Note
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.
3. Then tap the Build number option seven times to enable Developer Mode. You
will see a toast message when it is done.
4. Now go back to the main Settings screen, and you should see a new Developer
options menu you can access.
Note
On Google Pixel phones and some other devices, you might need to navigate
to Settings > System to find the Developer options menu.
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.
1. Download the Android SDK Platform Tools ZIP file for Windows.
2. Extract the contents of this ZIP file into an easily accessible folder (such as
Link copied to clipboard
C:\platform-tools).
3. Open File Explorer and browse to where you extracted the contents of this ZIP
file.
4. 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.
5. 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.
6. In the PowerShell/Terminal window, enter the following command to launch the
ADB daemon.
./adb devices
7. On your phone's screen, you should see a prompt to allow or deny USB Debugging
Link copied to clipboard
access. Tap Allow.
8. 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.
1. Download the Android SDK Platform Tools ZIP file for macOS.
2. Extract the ZIP to an easily accessible location (like the Desktop, for example).
3. Open Terminal.
4. 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/
5. Connect your device to your Mac with a compatible USB cable. Change the USB
Link copied to clipboard
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.
6. 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
7. On your phone, you'll see an Allow USB debugging prompt. Allow the connection.
8. 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.
1. Download the Android SDK Platform Tools ZIP file for Linux.
2. Extract the ZIP to an easily accessible location (like the Desktop, for example).
cd /path/to/extracted/folder/
For example:
Link copied to clipboard
cd /home/XDA/Desktop/platform-tools/
5. 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.
6. 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
7. Back on your Android device, you'll see a prompt asking you to allow USB
debugging. Go ahead and grant it.
8. 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:
Fedora/SUSE-based Linux users can type the following command to install ADB:
However, it is always better to opt for the latest binary from the Android SDK Platform
Link copied to clipboard
Tools release since the distro-specific packages often contain outdated builds.
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
1. 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.
2. Select Advanced system settings from the Related links section under Device
specifications.
4. Look for the variable named Path under System variables and double-click it.
5. Click New, then Browse and navigate to the folder where you extracted the ADB
files (e.g. C:\platform-tools).
6. When you see the folder location is properly listed, click the OK button out of all
the Windows you have opened to confirm.
7. 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
Link copied to clipboard
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, this is unnecessary. Here's how it works:
1. Note down the location where you extracted the ADB tools.
2. Open the Terminal app and make sure to be in the Home directory.
cd ~
3. 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
touch .bash_profile
For Zsh:
touch .zshrc
People who are already using custom shell configurations can skip this step.
5. Open the shell configuration file with TextEdit: For Bash:
open -e .bash_profile
For Zsh:
Link copied to clipboard
open -e .zshrc
If you prefer to use nano/pico/vi or any other CLI text editor, you can instead.
6. 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/
7. 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
8. 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.
Linux
1. Note down the location where you extracted the ADB tools.
2. Open the Terminal app and make sure to be in the Home directory.
Link copied to clipboard
cd ~
3. 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.
export PATH=$PATH:/path/to/extracted/folder/
For example:
export PATH=$PATH:/home/xda/platform-tools/
Warning
Be careful editing this file; do not add anything else or change anything else.
6. Save the file. Next, go back to the Terminal app and reload your shell settings:
source ~/.bashrc
7. 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
Link copied to clipboard
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.
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.
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
https://w w w .xda-developers.com/install-adb-w indow s-macos-linux/?utm_source=syndication 31/47
12/10/24, 1:51 PM How to install ADB on Window s, macOS, and Linux
you are good to go. It's worth noting that some browsers, such as Vivaldi, don't properly
Link copied to clipboard
display the popup for USB device connections, so they may not work for this.
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.
1. Make sure that your PC/Mac and the phone are connected to the same wireless
network.
3. Tap on the Wireless debugging option and select Pair device with pairing code.
4. Take note of the pairing code, IP address, and port number displayed on the phone
screen.
6. When prompted, enter the pairing code that you received in step 4. A message
should indicate that your device has been successfully paired.
Look at the IP address & Port section under Wireless debugging in step 3 for the IP
Link copied to clipboard
address and port.
8. If everything goes right, then you should see a message like the following:
connected to 192.168.68.100:37173
9. Now you’re ready to type whatever ADB shell command you want.
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:
adb devices
adb kill-server
Install an application:
Link copied to clipboard
adb shell
R E L ATE D
How to boot into recovery mode using button combos, ADB, and
root apps
R E L ATE D
How to debloat your phone (and more) without connecting to a PC
R E L ATE D
How to sideload apps on Android TV: APK Install and ADB Sideload
methods explained in easy-to-follow steps!
R E L ATE D
Control your Android Smartphone from your PC for free with scrcpy
R E L ATE D
ADB tips and tricks: Commands that every power user should know
about
Follow
Readers like you help support XDA. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.
THREAD 385
We want to hear from you! Share your opinions in the thread below and remember to keep it respectful.
Reply
Link copied / Post
to clipboard
Ghulam Mustafa
2024-06-19 06:48:36
Hi
14
Enrique
2024-07-06 19:06:01
No me agarra la aplicación
11
Ho Vinh
2024-07-01 22:21:27
Hay
11 2
ATR
2024-07-03 04:28:33
BTUS
10
Hzh
Link copied to clipboard
2024-08-31 11:48:05
9999999999999
2
hama
2024-07-15 21:31:36
Hay
8
Jhay
2024-06-19 21:23:32
hayyy
9
Maksad
2024-06-24 11:31:32
helpmi
8
Awais
2024-06-21 05:41:35
Nice
9
Link copied to clipboard
زيدان
2024-07-19 17:46:15
7
FARHAD
2024-06-19 07:55:10
hayy
4
KING
2024-09-05 00:30:11
3
اويس
2024-07-27 16:57:33
THENK YUO
3
Aze
2024-06-23 16:41:15
Link copied to clipboard
Offf
4
Ishak
2024-09-03 07:13:16
GOD
1
Yayaya
2024-06-22 15:27:46
Nice 👍
2
Abakar
2024-07-12 14:10:07
Pubg mobile
2
حسن
2024-06-19 12:42:48
Aohhd
2
star
Link copied to clipboard
2024-06-20 06:29:28
Nice
1
Sheikh
2024-09-05 23:45:56
Ffffh
Esra
2024-09-22 00:18:10
Ok
iqbal
2024-10-20 16:04:28
gg
2024-07-18 10:17:57
Hiredf
1
LIZO
2024-06-29 11:28:31
Yes
1 1
محمد
2024-10-04 11:10:22
Jhfi
Đả o
2024-07-18 02:52:12
1
Azimjon
2024-11-06 20:50:10
Love
Link copied to clipboard
عزت هللا
2024-12-08 04:07:13
Hxundikb
Kyaw
2024-09-07 03:32:39
Resolution changer
Show More
RECOMMENDED
Ayaneo Retro Mini PC AM02 review: A HP’s new mid-range Envy and Pavilion
powerful mini PC with a great design laptops get an AI upgrade for 2024
The Ayaneo Retro Mini PC AM02 is another mini PC HP unveiled a wide range of new Envy and Pavilion
from Ayaneo, and it's capable of quite a bit more laptops, offering Intel and AMD hardware with AI
than the first. enhancements.
Nvidia GeForce RTX 4070 Super Anker's 8-in-1 USB-C hub is now 39%
review: The best mainstream GPU go... off as it falls to its lowest price ever
The Nvidia GeForce RTX 4070 Super brings even Looking to expand with more ports? This Anker
more value to the best of the 40-series. compact USB-C hub is just the thing.
Follow Us
Advertising
Careers
Terms
Privacy
Policies