Все способы:
- Шаг 1: Скачивание и установка
- Шаг 2: Запуск утилиты ADB
- Способ 1: «Командная строка» Windows
- Способ 2: Windows PowerShell
- Дополнительно. Подключение Android-устройства к ADB на ПК
- Вопросы и ответы: 3
Шаг 1: Скачивание и установка
Прежде чем запуск консольной утилиты ADB станет возможным, конечно же, необходимо загрузить и инсталлировать её на компьютер. В действительности, существует множество вариантов получения и развёртывания софта, который обеспечивает функционирование Android Debug Bridge на ПК под управлением Windows 10, а следующая инструкция демонстрирует, как это сделать задокументированным разработчиками технологии Android Debug Bridge, а значит, самым надёжным и эффективным способом.
Скачать SDK Platform Tools (ADB и Fastboot) с официального сайта
- Перейдите по представленной перед этой инструкцией ссылке. В результате откроется веб-страница с описанием и возможностью загрузки включающего ADB пакета SDK Platform Tools на интернет-ресурсе Android Developers от Google.
- Переместитесь в раздел веб-страницы «Downloads»,
щёлкните по имеющейся здесь ссылке «Download SDK Platform-Tools for Windows».
- Прокрутите информацию в отобразившемся поверх веб-страницы окне до конца,
установите отметку в чекбоксе «I have read and agree with the above terms and conditions».
- Нажмите на ставшую активной после выполнения предыдущего шага кнопку «Download Android SDK Platform-Tools for Windows».
- Если это предполагают настройки браузера, укажите (и запомните) путь сохранения предоставляемого сайтом ZIP-архива на диске компьютера
(по умолчанию будет скачан в системную библиотеку Win 10 «Загрузки»). Подтвердите инициацию получения пакета
и дождитесь окончания этого процесса.
- По завершении скачивания файла platform-tools_rВЕРСИЯ-windows.zip откройте содержащую его папку
в Проводнике Windows.
Читайте также: Запуск «Проводника» в ОС Windows 10
- В результате разархивации пакета SDK Platform Tools образуется директория, которая содержит вложенную папку «platform-tools» –
именно она и является целевой в нашем случае.
По сути, на этом получение утилиты ADB можно считать завершённым, её уже можно запускать из указанной папки средствами консоли Windows 10 одним из предложенных далее в этой статье способов. При этом, для удобства в дальнейшем, а также полного соответствия рекомендациям разработчиков Android Debug Bridge необходимо скопировать или переместить каталог «platform-tools»
в корень
системного диска ПК (С:).
Кроме прочего, каталог с утилитой ADB можно переименовать по собственному усмотрению (например, сократить наименование или как-то иначе, но не применяя кириллических символов). При таком подходе запомните присвоенное каталогу с утилитой ADB имя, и точно вводите его вместо
platform-tools
при выполнении дальнейших инструкций из этого материала.
Далее извлеките всё содержимое архива в отдельный каталог. (С этой целью кликните правой кнопкой мыши по наименованию пакета, выберите «Извлечь всё» в открывшемся контекстном меню, подтвердите действие).
Подробнее: Распаковка ZIP-архивов в ОС Windows 10
Входящие в комплект SDK Platform Tools утилиты (не только рассматриваемая в этой статье ADB, но также Fastboot) в случае с Windows 10 могут быть запущены и эффективно эксплуатироваться в классической «Командной строке», а также её более современном аналоге – консольной оболочке «PowerShell». Далее рассмотрим подробно, как используются оба указанных инструмента для решения нашей задачи.
Способ 1: «Командная строка» Windows
По сути, чтобы получить доступ к функциям утилиты ADB через «Командную строку» Windows, достаточно открыть во второй содержащий компоненты первой каталог («platform-tools»). Практически это реализуемо минимум двумя путями, вы можете использовать тот, который кажется более удобным.
Вариант 1: Консольная команда «cd»
Самый распространённый и привычный большинству метод запуска консольной утилиты ADB заключается в открытии приложения «Командная строка» и переходе через неё в папку с целевым софтом с помощью специализированной текстовой команды:
- Любым способом запустите «Командную строку» Виндовс 10. К примеру, и быстрее всего с этой целью можно задействовать оснастку «Выполнить»: нажмите «Windows» + «R» на клавиатуре, введите в поле «Открыть» отобразившегося окошка следующий текст:
cmd
Щёлкните по кнопке «ОK» мышкой или нажмите «Enter».
Подробнее: Открытие «Командной строки» в Windows 10
- Введите команду перехода в каталог утилиты ADB – она состоит из указания
cd
и затем полного пути к целевой директории на диске компьютера. То есть, если вы точно следовали рекомендациям выше в статье, команда будет следующей:cd C:\platform-tools
Написав команду, отправьте её на выполнение — для этого нажмите «Ввод» на клавиатуре.
- Фактически всё, далее можно приступать к отправке текстовых команд ADB, — утилита готова к их приёму и обработке. Чтобы удостовериться в том, что отладочный мост введён в эксплуатацию, а также для получения списка основных команд ADB, можно ввести в консоли и отправить на выполнение следующее указание:
adb.exe
Вариант 2: Средства Проводника Windows
Более удобный и часто выполнимый быстрее, нежели вышеописанный, подход к запуску утилиты АДБ в классической «Командной строке» эксплуатирует возможности системного файлового менеджера Виндовс 10:
- Откройте Проводник Windows 10, перейдите в каталог ADB («platform-tools»).
- Кликните левой кнопкой мыши в (важно!) свободной от надписей области поля, которое расположено в верхней части окна Проводника и отображает путь
к текущей открытой вами папке.
- С клавиатуры введите следующий текст:
cmd
- Нажмите «Enter» — в результате запустится «Командная строка» Windows c уже открытой в ней папкой «platform-tools».
На этом наша задача считается решённой, вы можете приступать к вводу в «Командную строку» и отправке на выполнение команд Android Debug Bridge.
Способ 2: Windows PowerShell
Запуск ADB через поставляемое в комплекте ОС Windows 10 средство PowerShell выполняется не намного сложнее, нежели при использовании классической «Командной строки», а практически реализуется одним из двух нижеописанных путей.
Вариант 1: Консольная команда «cd»
Основной вариант запуска Android Debug Bridge средствами PowerShell фактически повторяет таковой в «Командной строке», — необходимо запустить консоль, а затем с помощью специальной команды открыть в ней каталог с утилитой ADB и сопровождающими её файлами.
- Откройте консольную оболочку PowerShell. Как и классическую «Командную строку» в Windows 10 это средство можно запустить большим числом способов, а быстрее всего — из меню дополнительных действий кнопки «Пуск» на «Панели задач» операционки: кликните по последней правой кнопкой манипулятора и выберите «Windows PowerShell» в отобразившемся перечне.
Подробнее: Запуск «PowerShell» в ОС Windows 10
- Введите команду перехода в папку утилиты ADB, — её синтаксис аналогичен рассмотренному выше в этом материале указанию для классической «Командной строки»:
cd C:\platform-tools
Нажав «Ввод» на клавиатуре, отправьте указание на выполнение консолью.
- Собственно, всё — средство ADB готово к выполнению своего предназначения. Дальнейшие ваши действия двухвариантные:
- При запуске ADB-команд в Windows PowerShell по умолчанию перед ними необходимо прописывать префикс
./
. То есть, к примеру, чтобы вывести в консоли список основных команд ADB в текущем случае, необходимо отправить на выполнение следующее текстовое указание:./adb.exe
После написания команды и нажатия «Enter» получаем следующий результат:
- Если подставлять
./
перед каждой передаваемой средствами ПоверШелл через Андроид Дебаг Бридж командой вы не желаете, то можете перед началом работы открыть себе доступ к «классической» командной строке в современной консольной оболочке. Для этого запустите в PowerShell команду:cmd
Далее отправляйте указания ADB мобильному девайсу c ОС Android без префикса:
- При запуске ADB-команд в Windows PowerShell по умолчанию перед ними необходимо прописывать префикс
Вариант 2: Расширенное контекстное меню папки
Ещё один метод запуска ADB в консольной оболочке PowerShell реализуется средствами Проводника Windows 10, а его использование часто оказывается более удобным, нежели описанный выше подход.
- Перейдите в папку с утилитой ADB через Проводник Win 10.
- Нажмите «Shift» на клавиатуре компьютера и, удерживая эту клавишу, щёлкните правой кнопкой манипулятора по свободному от элементов (значков файлов) месту в демонстрирующей содержимое каталога «platform-tools» области окна Проводника.
- По результату вышеописанной манипуляции откроется расширенное контекстное меню папки (после этого можно прекратить воздействие на кнопку «Shift» клавиатуры). В меню выберите пункт «Открыть окно Power Shell здесь».
- Итогом манипуляций станет запуск приложения Windows Power Shell c уже открытым в нём каталогом «platform-tools». На этом наша задача считается решённой, приступайте к вводу и отправке на выполнение команд Android Debug Bridge.
(Принцип здесь тот же, что и при рассмотренном выше варианте запуска утилиты: либо предварительно запустите команду
cmd
, а затем отправляйте ADB-команды в их «стандартном» виде; либо подставляйте префикс./
перед каждым указанием).
Дополнительно. Подключение Android-устройства к ADB на ПК
Чтобы скачивание, развёртывание и запуск ADB в среде Windows 10 позволили достичь конечных целей своего осуществления, то есть вы получили возможность производить вмешательство в работу системного ПО управляемого ОС Android мобильного девайса с компьютера, чрезвычайно важно правильно подключить смартфон или планшет к консольной утилите. Полный алгоритм выполнения данной операции изложен ниже.
Скачать универсальные драйверы от Google для работы с Android-девайсами через ADB
- Прежде чем приступать к выполнению вмешательства в работу системного ПО смартфона или планшета под управлением ОС Android с компьютера через ADB, на мобильном устройстве необходимо активировать особый режим функционирования – «Отладка через USB».
Сделайте это в первую очередь, а подробные инструкции по решению данного вопроса, если они необходимы, вы обнаружите в статьях по следующим ссылкам:
Подробнее:
Как включить «Отладку по USB» на Android-девайсе
Активация режима «Отладка по USB» на смартфонах Xiaomi (Mi, Redmi, POCO) - Подсоедините Андроид-девайс с активированной «Отладкой по ЮСБ» к USB-порту компьютера кабелем.
- Далее, например из контекстного меню кнопки «Пуск» на «Панели задач» операционки, откройте «Диспетчер устройств» Windows 10.
- Убедитесь, что мобильное устройство определилось операционной системой правильно и для него загружен необходимый драйвер. В таком варианте «Диспетчер устройств» отображает категорию «Android Phone», и в ней — запись «Android Composite ADB Interface» (последняя не должна сопровождаться какими-либо отметками, типа восклицательного знака на жёлтом фоне).
Если с определением Android-девайса в «Диспетчере устройств» Windows 10 наблюдаются какие-либо проблемы, чаще всего их следует решать путём установки/переустановки ADB-драйвера.
Читайте также: Инсталляция драйверов для работы с Android-девайсами с ПК
Опять же, в большинстве случаев, самым правильным выбором драйвера для обеспечения сопряжения ПК и Андроид-устройства через АДБ будет универсальный компонент, доступный для скачивания на интернет-ресурсе «Android Developers»
(ссылка доступна перед настоящей инструкцией).
- Запустите утилиту ADB любым из предложенных выше в этом материале способом.
Напишите и отправьте на выполнение консолью Windows 10 следующую команду:
аdb devices
- Если сопряжение ПК и мобильного устройства через Android Debug Bridge осуществляется впервые, «Командная строка»/«PowerShell» в ответ на указание из предыдущего пункта инструкции выдаст следующее:
List of devices attached
ID_Android-устройства unauthorized
В таком случае, возьмите (не отсоединяя от компьютера) смартфон или планшет, разблокируйте его. Поставьте отметку «Всегда разрешать отладку с этого компьютера» в отображаемом на экране Android-девайса окне «Отладка по USB», а после этого коснитесь кнопки «Разрешить».
Далее перейдите к окну консоли с запущенной утилитой ADB на компьютере, повторите запуск команды
аdb devices
. - Получив в «Командной строке» или «PowerShell» ответ в виде строчки
ID_Android-устройства device
, вы можете переходить к непосредственному решению возлагаемых на ADB задач, — смартфон/планшет теперь подключён к утилите правильно и готов к выполнению её (а по сути – ваших) указаний.
Наша группа в TelegramПолезные советы и помощь
You are here: Home/ Applications/ Download Android SDK Platform Tools- ADB and Fastboot For Windows/Mac/Linux
There are various tools available on the Android Software Development Kit, popularly referred to as Android SDK or Android Devkit. The many tools you will find on this devkit are all unique and designed to serve various specific purposes in Android development. Talking about Android SDK Platform-Tools; this is one of the components of the Android SDK, which includes some essential tools for Android development; the tools included are ADB, Fastboot, and Systrace. These tools are useful in the hands of Android app developers. That is to say, if you’re not an app developer for Android mobile OS, it does not mean it will not use for you. Nevertheless, these tools can be employed by ROM, Root, Recovery developers and phone technicians to root Android devices, unlock bootloaders, as well as flash new custom files.
What Platform Can It support? Where Can It be used?
As said above, the platform-tools is a component of Android SDK containing what are considered to be the essential tools for Android app development, viz, ADB, Fastboot, and Systrace. These tools are available for Windows, Linux, and macOS computers. So, if you’re an Android developer, these tools are vital to you, and you can get the version for your computer OS.
Download links
Please refer Android License regarding the software before download.
- Windows
- Mac
- Linux
How to use Android SDK Platform Tools?
- Firstly, you have to download the tools in its ZIP format and extract it to your computer. Make sure you download the version for your OS.
- You should boot your mobile into fastboot/recovery mode and connect with your PC.
- Navigate to the extracted folder using Command Prompt or Terminal. Use the following ADB and Fastboot commands as per your requirements.
Minimal ADB and Fastboot
If you are a regular user who uses adb and fastboot for simple usage like a flash, bootloader unlocks, you can use this software. It is a Windows version. All you have to do is download, extract, and install the executable file.
- Download the ADB drivers.
Installation Steps
- Download and extract the files. Select the adb setup file and run this as Administrator.
- The installation window will open press “Y” twice to install adb system-wide.
- Now you can find the adb files in your installed folder. You can access the command anywhere within your PC. But, it is better to copy the flash and boot files in this folder for the process.
How to use ADB
There are various things you can do with ADB; this tool supports a lot of commands to trigger most functions. Most of them deal with the recovery mode. I try to cover some essential commands.
Note: you must activate “Developer Options” on the device and turn on “USB Debugging” on the Android device before running ADB commands.
ADB commands
ADB Command |
Function |
adb reboot – bootloader |
Reboots Android device in bootloader mode |
adb reboot |
Reboots Android phone in normal mode |
adb push |
Move a file from local system to an Android phone’s location |
adb devices |
Displays all connected ADB compatible devices |
adb pull |
Moves a file from Android to your PC |
adb install |
Installs an app from your system’s .apk file location to your Android device |
adb connect |
Use ADB commands over Wi-Fi Network |
adb backup |
Backs up the Android device |
adb shell screencap |
Captures a screenshot of the device |
adb sideload file |
Push the file to your mobile device and Install it. |
Launching ADB requires you know about CMD – Command Prompt. This is because you need to start CMD and use commands to access the folder where you extracted the Platform Tools and launch adb.exe.
How to use Fastboot
Fastboot installs alongside ADB when you extract the ZIP file. Fastboot allows you to run commands on and Android device that is in bootloader mode. There are, however, other ways to use an Android device in bootloader mode, but using Fastboot is the best option. Also, it is possible to unlock an Android device bootloader using Fastboot to install a custom system file.
However, before Fastboot commands can work on an Android device, you must activate “Developer Options” on the device and turn on “USB Debugging.”
Fastboot commands
Fastboot Commands |
Functions |
fastboot oem lock |
re-locks the bootloader of an unlocked device |
fastboot devices |
Shows the serial number of a connected Android device |
fastboot flash recovery (filename) |
Flash the file from PC |
fastboot boot recovery (filename) |
Boot the data from PC |
fastboot oem unlock |
Unlock the bootloader of connected Android device |
What is Systrace?
We can say it is an in-built advanced tool in Android Studio to understand your app performance in your Android mobile. It can give you an overview of background process performance, How much CPU it is accessing to do things like that. It also needs ADB to perform the commands. Refer- Systrace Commands.
What More?
The use of these tools is infinite. Our ideas limit it. I try to give some ideas about how to use them. I can say I gave 0.1%. There is plenty of add ons are available, and you can use them as per your requirement. These SDK tools are essential to interact with your mobile with the Android commands. You can do plenty of customizations using these commands. If you hear about the country restriction pixel 4 soli, Yes, you can also lift the restriction. You can also disable bloatware apps in Samsung devices. If you face any problem, or you need additional adb commands, comment below.
Source, (2)
Selva Ganesh is the Chief Editor of this Blog. He is a Computer Science Engineer, An experienced Android Developer, Professional Blogger with 8+ years in the field. He completed courses about Google News Initiative. He runs Android Infotech which offers Problem Solving Articles around the globe.
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!
ADB is a useful command-line tool that can perform countless developer-level tasks on Android devices. To use ADB and Fastboot commands on Windows, macOS, or Linux to control and customize your Android phone or tablet, you must set up the ADB and Fastboot drivers on your computer. Below, you can download the latest Android SDK platform tools (zip) for Windows, Linux, and macOS directly from the Google servers.
Using ADB and Fastboot commands, you can install, uninstall, debug, and emulate apps, enable and disable system settings, back up your data, push and full files, and remotely control your device from your computer. Moreover, you can also flash factory images, custom recovery, sideload APK, and so on.
SDK is an abbreviation for Software Development Kit. The SDK platform tools contain the ADB and Fastboot drivers for Android. These drivers are essential because they let a computer establish a connection with an Android phone, tablet, or smartwatch via a USB cable or ADB over Wi-Fi. The ‘SDK platform tools’ are a part of the Android SDK Manager and Android Studio. However, you can download it separately as a Zip package for Windows, Linux, and Mac.
Below you can download the Android SDK Tools for all three major operating systems.
You can also use ADB commands directly on your Android device without a computer.
- Via a Terminal App
- Via WebADB in Chrome browser
How to Set up Android SDK Platform Tools
Now that you have downloaded the SDK platform tools, let’s see how to set up ADB and Fastboot drivers on your Windows PC.
1. Launch a Command Window with Platform Tools Path
First, unzip the “platform-tools-latest.zip” to an easily accessible location on your computer and follow our detailed instructions below. To use ADB commands, you must launch the command window with the path of the ‘platform-tools‘ folder. You can do that in 2 ways.
Method 1: From the Windows Context Menu
- Open the folder that contains the ADB and Fastboot files.
- On Windows 10, press the Shift key and right-click in an empty area inside the folder window. Windows 11 users can right-click inside the folder window.
- Select the ‘Open in Terminal‘ (Windows 11) or ‘Open PowerShell window here‘ (Windows 10) option from the context menu.
Method 2: From the File Explorer Address bar
Open the ‘platform-tools‘ folder, type “cmd” or “powershell” in the folder window address bar, and press Enter.
A command window with the path of the ‘platform-tools’ folder path will launch as shown in the screenshot below.
2. Enable USB Debugging from the Developer Options
Next, you must enable USB debugging so your Android device and computer can communicate. You can find it under Settings> Developer options. If you don’t find the Developer Options in device Settings, let’s enable it first.
Navigate to Settings > About device> Software Information and tap the Build number 7 times. Enter your device PIN when prompted to unlock the hidden Developer Options on your Android device.
Now go back to Settings > Developer options, tap the toggle next to USB debugging, and select OK when prompted.
3. Verify and Authorize ADB Connection
Finally, let’s see how to connect to and authorize ADB on your device.
- Navigate to Display settings on your Android device and extend the Screen timeout duration to 5 to 10 minutes.
- Connect your phone or tablet to the computer using a compatible USB cable.
- Now launch a command window, type the following command, and click Enter.
adb devices
- At this time, you’ll receive a prompt on your Android device to authorize ADB via a USB connection. Tap on the Allow option.
- You’ll see the list of the Serial numbers of attached devices in the command window represented by a string of alphanumeric values as shown below.
You are all set to use ADB and Fastboot commands. You can also set up system-wide ADB so you can execute commands from anywhere without navigating to the “platform-tools” directory every time.
Should you encounter any errors while using ADB, refer to our tutorial on fixing the ‘ADB or Fastboot is not recognized‘ issue.
Having set up ADB and Fastboot on your PC, you must explore our detailed list of commands to explore what you can do with them.
- ADB commands list
- ADB Shell commands list
Was this Article helpful?
YesNo
ADB (Android Debug Bridge)
ADB (Android Debug Bridge) is a versatile command-line tool that allows developers and power users to communicate with Android devices from a computer. It enables debugging, file transfer, app installation, shell access, and more.
📌 Features
- Connect and control Android devices via USB or Wi-Fi
- Install and uninstall applications
- Access the device shell for debugging
- Transfer files between a PC and an Android device
- Capture screenshots and screen recordings
- Reboot and recover device functions
- Bypass bloatware and uninstall system apps
🚀 Installation
Download ADB
You can download ADB directly from the following link:
Download ADB.zip
Windows
- Download the ADB Platform Tools from Google’s official site.
- Extract the ZIP file into a folder (e.g.,
C:\adb
). - Open Command Prompt and navigate to the folder:
- Test ADB installation by running:
Mac & Linux
- Open the terminal and install ADB using:
brew install android-platform-tools # For Mac (Using Homebrew) sudo apt install adb # For Linux (Debian-based)
- Verify installation:
🔧 Usage
Enable Developer Mode & USB Debugging
- Go to Settings > About Phone.
- Tap Build Number seven times to enable Developer Options.
- Go to Settings > Developer Options and enable USB Debugging.
Basic Commands
1️⃣ Check Connected Devices
2️⃣ Access Device Shell
3️⃣ Install APK
4️⃣ Uninstall App
adb uninstall com.example.app
5️⃣ Transfer Files
- Send file to device:
adb push file.txt /sdcard/
- Retrieve file from device:
adb pull /sdcard/file.txt .
6️⃣ Reboot Device
7️⃣ Disable or Remove System Apps (Caution ⚠️)
- Disable:
adb shell pm disable-user --user 0 com.android.example
- Uninstall:
adb shell pm uninstall --user 0 com.android.example
📜 License
This project is licensed under the MIT License.
🤝 Contribution
Feel free to open issues or submit pull requests if you have improvements or bug fixes.
🌟 Support
If you find this useful, don’t forget to star ⭐ the repository!
Happy debugging! 🛠️