How to install adb on windows, macos, and linux
Содержание:
- Плитка
- What is ADB & Fastboot?
- Download Google USB Drivers
- Simulating System Activities
- What else can I do with ADB?
- Install Android USB Drivers via android_winusb.inf
- How to Use SDK Platform-Tools
- USB Drivers and android_winusb.inf file
- 5. Brevent
- How fresh and Updated is the Minimal ADB Fastboot Tool?
- Where to Download Minimal ADB and Fastboot?
- How to Install Minimal ADB and Fastboot?
- What you can do when ADB and Fastboot is Installed
- Команды ADB
- Copying Files to or from an Emulator/Device Instance
- What is SDK Platform-Tools?
- Как пользоваться ADB run
Плитка
Меню быстрых настроек может выполнять все виды полезных задач прямо из тени уведомлений. Но вы также можете улучшить его, добавив настраиваемые переключатели быстрой настройки.
Tiles собирает эти пользовательские переключатели быстрых настроек в одном месте. Существует почти 70 категорий, позволяющих управлять жизненно важными настройками телефона, включая яркость, громкость, местоположение, данные сотовой связи и многое другое. Вы можете активировать или деактивировать каждую плитку, чтобы не загромождать экран быстрых настроек.
Настройка ADB
Некоторые быстрые настройки переключателей требуют ADB. Для этого настройте ADB и вставьте эту команду:
Получив доступ, вы можете контролировать или управлять анимацией, роумингом данных, режимом погружения, расположением, отладкой по USB и многим другим.
Уникальные черты
- У вас есть контроль, чтобы показать или скрыть видимость плитки.
- С плитками активности вы можете добавлять плитки для запуска скрытой активности некоторых приложений.
- Вы можете выбрать режим выборочного местоположения с помощью плиток местоположения. Опции включают высокую точность, экономию батареи и режим только устройства.
Скачать: Плитка (1 доллар)
What is ADB & Fastboot?
ADB is generally used for development when trying to run applications on the phone from the computer so you can debug (hence the name) issues with your app you are creating. Let’s be real though, most of the time, it’s used for rooting Android devices.
Since ADB allows you to communicate with an attached Android phone on a development level it’s extremely handy when we want to issue commands that allow us to, for example, push files to the device and then execute those files all in an effort to root the phone.
Fastboot is similar to ADB in that it’s used for issuing commands to the attached device, but in fastboot mode it’s really more for flashing different parts of Android (i.e. updating the system with a newer version, erasing all the user data, etc.). This mode is more used for manufacturers to diagnose and fix devices with software issues, but, like with ADB, it can also be pretty instrumental in helping our rooting efforts.
We can use fastboot to flash a new recovery image that then allows us to then gain root access that way.
Long story short, when trying to root your Android device, both ADB and Fastboot are tools you’ll probably need to have all setup.
Because ADB and Fastboot are meant really for developers, they aren’t the most intuitive when it comes to setting them up. Because of this, I’m going to layout the easiest ways to get both working on the two most popular operating systems that you guys might have: Windows and Mac (sorry, Linux).
Download Google USB Drivers
Now, there are two different ways/methods to download the USB driver on Windows. You can either download the Google USB Driver ZIP file manually. Or, you can use the SDK Manager in the Android Studio to download it.
The latter gives an added benefit, that is the SDK Manager will automatically notify you when a newer version is available. The former method, on the contrary, will require you to manually check if a newer driver version is available and download it again.
In our personal experience, downloading the ZIP package directly is easier than using the Android Studio. But the choice is solely up to you. We have covered both the methods below.
Note: If you’re using macOS or Linux, you would not need these drivers.
Direct Download
Just click on the link below to download the Google USB Driver ZIP file to your PC.
- Latest version: usb_driver_r13-windows.zip
- Previous versions:
- usb_driver_r12-windows.zip
- usb_driver_r11-windows.zip
- usb_driver_r10-windows.zip
Once downloaded, extract the ZIP file to a suitable location on your computer. The extracted ‘usb_drivers’ folder should contain the required ‘android_winusb.inf’ driver file.
Download via Android Studio
First of all, make sure that you have downloaded and installed the on your Windows PC. Once you have it installed, follow the instructions below:
- Launch ‘Android Studio’ on your PC.
- Click on ‘Tools’ and select ‘SDK Manager’.
- Go to the ‘SDK Tools’ tab.
- Select ‘Google USB Driver’ and click on ‘Ok’.
- Finally, click on ‘Ok’ when prompted with the ‘Confirm change’ message.
- You should see a ‘License Agreement’ message on the screen. Simply select ‘Accept’ and click on ‘Next’.
Android Studio will now download the Google USB drivers to ‘android_sdk\extras\google\usb_driver\‘ on your PC. Here ‘android_sdk’ is the folder where the Android SDK is installed on your PC.
Simulating System Activities
Many system activities can be simulated directly through adb shell commands. Often, it turns out very helpful in terms of automating the system testing process. For example, we can capture a screen shot and attach it with the bug report as follows.
adb shell screencap /sdcard/DCIM/Camera/mydevice.png
Furthermore, we can utilize the activity manager to instantiate activities to behave as if users are manually performing the tasks, such as making a phone call.
adb shell am start -a android.intent.action.CALL -d tel:+<phone_number>
Similarly, to simulate the delivery of a text message and key strokes, here are the ADB commands issued in a sequence on my Google Nexus 5. Key event 22 is Android’s KeyEvent.KEYCODE_DPAD_RIGHT and 66 is KeyEvent.KEYCODE_ENTER. On my device, event 66 needs to be issued twice for two consecutive device screens.
adb shell am start -a android.intent.action.SENDTO -d sms:CC:+<phone_number> --es sms_body ":+<message_body>" --ez exit_on_sent true adb shell input keyevent 22 adb shell input keyevent 66 adb shell input keyevent 66
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!
- How to disable any pre-installed system app bloatware on Android without root
- How to debloat your phone (and more) without connecting to a PC
- How to remove Facebook bloatware from the OnePlus 8 series and OnePlus Nord
- Tasker 5.9.2 beta lets you run ADB shell commands without being tethered to a PC
- Control your Android Smartphone from your PC for free with scrcpy
- How to Pair Android Wear Watches to New Phones without Factory Resetting
Install Android USB Drivers via android_winusb.inf
- To begin with, download the USB drivers from the above Downloads section.
- Extract it to any convenient location on your PC and you should get the usb_driver folder. Within that, there will be the android_winusb.inf file, which we will be using in this section.
- So right-click on the Windows icon and select Device Manager from the menu.
- Within that, go to Other Devices and your device will be listed there with a yellow exclamation mark.
- Right-click on it and select Update Drivers.
- Then click on Browse my computer for driver software.
- After this, select Let me pick from the list of device drivers on my computer.
- Then select Show all devices and hit Next.
- Now click on the Have Disk button, then click on Browse.
- Navigate to the usb_driver folder, select the android_winusb.inf file and click Open > OK.
- Select Android ADB Interface and click Next.
- You will now get an update driver warning, click YES, and finally click Install.
- The installation process will now begin and once completed, you will be notified of the same.
So with this, we conclude this section on how to install Android USB Drivers using the android_winusb.inf. Have any queries? Let us know in the comments below.
- How to Fix Google Photos Permissions Prompt on Android 11
- How to Pass Magisk SafetyNet on Rooted Android 11
- Fix Magisk patched boot.img issue while Rooting Android 11
- How to Root Android Devices Without TWRP Recovery
Sadique Hassan
administrator
A technical geek by birth, he always has a keen interest in the Android platform right since the birth of the HTC Dream. The open-source environment always seems to intrigue him with the plethora of options available at his fingertips. “MBA by profession, blogger by choice!”
How to Use SDK Platform-Tools
Now that you have already downloaded the SDK Platform-tools, you need to install it or set it up on your computer. If you don’t know what to do with the zip file you just downloaded and how to execute the ADB and Fastboot commands, I am going to explain everything you need to know.
First of all, you need to unzip the “platform-tools-latest.zip“. You can extract it anywhere on your computer but I prefer saving the files to a folder created as “Android” on the C drive on my Windows PC. Having extracted the zip file, you need to launch a command prompt window before you can execute an ADB or Fastboot command.
How to Launch a Command Window?
It’s very easy to launch a command prompt window on a Windows PC. Click the Search icon next to the Windows menu icon on the taskbar and hit the Enter key. In case you need to launch the Command or CMD window from inside the Platform-tools folder, there are 2 ways to do that.
Method 1
- Open the folder in which you extracted the content of the Platform-tool.zip file.
- While pressing the Shift key on the keyboard, perform a right-click on your mouse at an empty place inside the folder window.
- From the context menu pop-up, select the “Open command prompt here” option.
- You can now execute any ADB or Fastboot command.
Method 2
Well, this method is far easier than the one I described above. You can simply launch a command window from inside the platform-tools folder by typing “cmd” in the Windows file explorer address bar as shown below and hitting the Enter key on your PC’s keyboard.
Note: Make sure to enable the USB debugging option on your Android device. You can find it under Settings> Developer options. In case you don’t see Developer Options listed under device Settings, open About device> Software Information and tap the Build number 7 times to unlock the hidden Developer options on your Android device.
You need to allow the debugging option so that your devices and computer can communicate and interact with each other. When you execute a command in the cmd window, you’ll get a pop-up on your Android’s screen asking you to Allow USB debugging.
Verify ADB Connection
Note: Make sure you have already installed the proper Android USB Driver from your device’s manufacturer on your computer.
- Having enabled USB Debugging from Developer options, connect your phone or tablet to the computer using a compatible USB cable.
- Now launch a command window and type the following command and click the Enter key on the keyboard.
adb devices
- You’ll see the list of the IDs of attached devices in the Command Prompt window represented by a string of alphanumeric values as shown below.
Please note that to sideload and APK on your Android phone via ADB or to flash a system image (.img) file using Fastboot commands, you need to place those files inside the “platform-tools” folder first. You can also enable system-wide ADB and fastboot so that you can execute commands without navigating to the “platform-tools” directory every time. If you encounter any problem while running commands, read my tutorial on fixing ADB or Fastboot is not recognized error.
That’s all for now! I’ve also prepared a very exhaustive list of useful ADB, ADB Shell, and Fastboot commands in a dedicated tutorial. Don’t forget to check that.
Now that you have set up SDK Platform tools on your computer, here are a few things that you should start with.
- Uninstall system apps on Android without root
- Turn Safe Mode On or Off using ADB command
- Turn off USB Debugging and Developer options using ADB command
USB Drivers and android_winusb.inf file
You might have come across various sites where they have hosted different driver files for different devices. Truth be told, that isn’t required. This is because as opposed to the general notion, there is just one single USB Driver for all Android devices. Even the OEM specif tools such as Motorola Device Manager for Motorola, Mi Flash Tool for Xiaomi, etc also install the same drivers.
To be a little more specific, it is only the android_winusb.inf that acts as the Android USB Drivers. You could verify the same by installing any driver file from any OEM and upon extraction, all will lead to the android_winusb.inf file itself. With that said, this guide will focus on the official USB drivers provided by Google and we will list out their installation steps. So without further ado, let’s get started.
5. Brevent
Приложения, работающие в фоновом режиме, могут потреблять системные ресурсы и сокращать время автономной работы. Есть много приложений, которые могут помочь предотвратить это, в том числе популярное приложение Greenify. Но они часто бывают беспорядочными, и сложно реализовать определенные функции.
Brevent может запускать приложения в режиме ожидания или принудительно останавливать приложения, просто используя ADB.
Настройка ADB
Запустите приложение и настройте ADB. Затем введите эту команду:
Brevent не принудительно останавливает приложения и не переводит их в режим ожидания по умолчанию. Вы должны сначала поместить их в список нарушений. Нажмите и удерживайте любое приложение, затем нажмите кнопку « Запретить» . Как только ваше приложение окажется в этом списке, оно больше не будет оставаться активным в фоновом режиме.
Нажмите на приложение и выберите « Разрешить синхронизацию» в диалоговом окне, чтобы получать уведомления или выполнять задачи.
Уникальные черты
- Вы можете ограничить приложения, расходующие заряд аккумулятора, такие как Facebook, но при этом разрешать синхронизацию для получения уведомлений.
- Для редко используемых приложений вы можете установить агрессивные параметры, чтобы принудительно остановить их, как только вы нажмете кнопку возврата.
Скачать: Brevent (бесплатная, премиум-версия доступна)
How fresh and Updated is the Minimal ADB Fastboot Tool?
It is always advised to check and install latest software applications or tools on your devices. Every year Android is bringing more and more new updates hence the tools must be updated accordingly. The same is applied for the Minimal ADB and Fastboot tool for Windows which is at least 2 years old.
The latest update in the series was v1.4.3 which was released on 9th February 2018 which is quite old. As of writing this article, the ADB and fastboot version on the Minimal ADB Fastboot v1.4.3 was v1.0.39 and the latest ADB and fastboot version running is 1.0.41 (as of Feb 2020).
From the usability point of view, this is easy to install but this running behind the latest update. There is nothing wrong in installing this as long as this is working for you.
But to work with latest ADB or fastboot commands, for example adb get_active etc. commands or some more newer commands it is always recommended to install the newer ADB and Fastboot binaries which you can get it from the platform tools for windows.
Where to Download Minimal ADB and Fastboot?
Below are several versions of Minimal ADB and Fastboot exe installer available for Windows ONLY
v1.4.3 Download
v1.4.2 Download
v1.4.1 Download
v1.4.0 Download
v1.3.1 Download
How to Install Minimal ADB and Fastboot?
- Download the latest available “Minimal ADB and Fastboot” .exe installer file for Windows.
- Double click on the file that was downloaded.
- Now click on the Next button and then follow the on-screen instructions to install the minimal ADB Fastboot installer.
- Once installed, you can use the ADB and Fastboot commands from any directory on the command windows on Windows OS.
What you can do when ADB and Fastboot is Installed
ADB and Fastboot are two such tools for an Android phone by which you can get a lot of information about the Android OS runtime. Following are some of the possible usage of ADB and Fasboot:
- ADB Sideload (a command option in ADB) is used to install custom ROM
- ADB command is used to capture logcat from Android runtime
- Fastboot is used to unlock bootloader of an Android phone
- Fastboot is used to install TWRP recovery, or boot image or system image etc.
Команды ADB
Перед выполнением команд adb полезно знать, какие экземпляры устройств подключены к серверу adb. Список подключенных устройств можно посмотреть следующей командой.
В ответ adb выведет серийный номер, состояние и описание (параметр -l) подключенных устройств.
В примере ниже показаны три устройства. Первые два — эмуляторы, третье — аппаратное устройство, подключенное к компьютеру.
Если запущен только один эмулятор или подключено только одно устройство, команда adb отправится на это устройство по умолчанию. Если же запущено несколько эмуляторов и / или устройств, необходимо использовать параметры -d, -e или -s, чтобы указать устройство, на которое должна быть направлена команда.
Нижеприведенная команда отправится на устройство с указанным серийным номером.
Команда отправится только на устройство подключенное через USB. Выдаст ошибку, если подключено больше одного устройства.
Команда отправится на устройство в эмуляторе. Выдаст ошибку, если подключено больше одного эмулятора.
Подсоединиться к андроид хосту по протоколу TCP/IP (по умолчанию порт 5555, если не указан другой).
Отсоединиться от андроид подключенного через TCP/IP (по умолчанию порт 5555). Если не задан ни один параметр, отключиться от всех активных соединений.
Перезапуск демона с правами root.
В некоторых случаях может потребоваться остановить сервер adb, и перезапустить его, чтобы решить проблему (например, если adb не отвечает на команды).
Остановить сервер.
Запустить сервер.
Копировать файл или папку на устройство.
Например,
Копировать файл или папку с устройства на компьютер.
Копировать с компьютера на устройство только новые файлы. С ключом -l не копировать, только создать список.
Установить приложение на устройство.
Например,
Ключи:-l блокировка приложения;-r переустановить приложение, с сохранением данных;-s установить приложение на карту памяти.
Чтобы удалить приложение с устройства используйте следующую команду.
Ключ -k означает, не удалять сохраненные данные приложения и пользователя.
Сделать скриншот экрана устройства.
Полученный скриншот можно сразу забрать на компьютер.
Для записи видео с экрана устройства используйте команду screenrecord.
или с параметрами
Чтобы остановить запись используйте комбинацию клавиш Control + C (Command + C на Mac). По умолчанию максимальный лимит для видео составляет 3 минуты.
С полным списком команд adb можно ознакомиться на сайте .
Copying Files to or from an Emulator/Device Instance
You can use the adb commands and to copy files to
and from an emulator/device instance. Unlike the command,
which only copies an APK file to a specific location, the and
commands let you copy arbitrary directories and files to any location in an
emulator/device instance.
To copy a file or directory (and its sub-directories) from the emulator or device, use
adb pull <remote> <local>
To copy a file or directory (and its sub-directories) to the emulator or device, use
adb push <local> <remote>
In the commands, and refer to the
paths to the target files/directory on your development machine (local) and on the
emulator/device instance (remote). For example:
adb push foo.txt /sdcard/foo.txt
What is SDK Platform-Tools?
Essentially, the ‘platform-tools” is a command-line tool meant for developers only. They are a part of the Android SDK Manager and Android Studio and are used to perform more complicated tasks like developing, analyzing, and debugging Android apps APK (Android Application Package file). Using them you can emulate apps, edit the visual layouts, and test them without a real Android device.
Not too long ago, we had to download a full Android SDK suite or Android Studio and get the Platform-tools. Google then decided to release the Android SDK Platform-tools separately. Now, we can download the latest version of Android SDK Platform-tools for Windows, Linux, and Mac in an easy-to-download Zip package.
Как пользоваться ADB run
Чтобы понять, как использовать утилиту, необходимо познакомиться с установкой и основными командами. Подключение к гаджету осуществляется при помощи компьютера и USB кабеля или по беспроводной сети.
Понять, что подключение состоялось, можно осуществив ввод adb devices. Затем должно появиться сообщение: «List of devices attached«, говорящее о том, что соединение произошло. Подключение через wi-fi происходит при помощи adb wireless. На мобильном устройстве должны стоять root права.
Для работы необходимо включить отладку по USB на гаджете. Обычно этот пункт находится в настройках. Если его нет, то можно его поискать в параметрах разработчика. Это меню скрыто, для его включения следует найти строчку с номером сборки в настройках Андроид, несколько раз кликнуть на нее (от 5 до 10 раз). Где-то после половины нажатий появится уведомление, что вы все делаете правильно, а потом будут предоставлены права разработчика. Затем можно вернуться к настройкам, где появится пункт «параметры разработчика». Здесь и происходит включение отладки.
Утилита обладает рядом положительных качеств:
- Простота установки.
- Простое управление.
- Легкая проверка обновлений.
Используем команду Выполнить в Windows
Установка
Прежде чем установить ADB, ее необходимо скачать, это можно сделать бесплатно. Скачать ADB можно на сайте 4pda. Официальный ресурс не дает возможности скачать утилиту отдельно, а только всем пакетом Android SDK. Установка программы происходит с помощью стандартного мастера установки.
Весь процесс прост и интуитивно понятен. Сам установщик предлагает подсказки, направляя все действия.
После этого нужно установить драйвера для своего мобильного устройства, иначе приложение не увидит устройство. Проще всего воспользоваться утилитой для автоматической установки Adbdrivers. Но также можно скачать драйвера для Windows 7, 8 или 10 с официального сайта производителя.
В случае отсутствия установщика, драйвера можно установить вручную, для этого:
- Запускаем Диспетчер устройств. Найти можно в панели управления или воспользоваться поиском в системе
- Ищем неопределившееся устройство, или ваш смартфон. Кликаем правой клавишей мыши на устройстве и выбираем Обновить драйвер
- В открывшемся окне выбираем пункт – Выполнить поиск на компьютере, после чего указываем путь к папке и подтверждаем.
Обзор интерфейса и команды ADB run
Рассмотрим все пункты меню, предложенные программой, принцип их работы:
- Device attached? – отвечает за соединения ПК и смартфона, но обязательно необходимо включить отладку USB.
- Move – отвечает за перемещение файлов с ноутбука на смартфон. Здесь присутствует как автоматическая, так и ручная возможность перемещения.
- Install Android App to Device – дает возможность устанавливать приложения, при этом возможны варианты сохранения и перемещение на карту памяти.
- Reboot Device – разнообразные режимы перезагрузки Андроида:
- Reboot – стандартная;
- Reboot Bootloader – перезагрузка в загрузчик bootloader;
- Reboot Recovery – перезагрузка в меню recovery.
- Fastboot – прошивка, перепрошивка системы. Все настройки заданы автоматически.
- Unlock Gesture Key – разблокировщик графического ключа, также справляется с пин кодами, фейс кодами.
- Manual – позволяет прописывать команды вручную.
- Check Update – проверка новой версии программы.
- Intsall Bootanimation – устанавливает и изменяет анимацию при включении устройства.
- Memory and Partitio – знакомит с блоками и разделами Андроида.
- Run Script – работа со скриптами.
- Backup – создание резервной копии.
- Odex – odex-ирование прошивки, учитывая разнообразные параметры.
-
Screnshot/Record – скриншоты, возможность записи видео.
- Exit – соответственно выход из программы.
Прошивка телефона посредством ADB run
Программа позволяет менять прошивку гаджета. Для этого достаточно ее установить, подключиться к ПК и воспользоваться утилитой Fastboot. Файлы, которые следует прошить должны находиться в одной папке с утилитой.
Для начала необходимо перевести устройство в режим bootloader при помощи меню.
Затем необходимо разархивировать заранее скачанные файлы с прошивкой. После этого следует выбрать пункт Run SCRIPT и в открывшееся окно поместить файлы прошивки и закрыть его. Нажать на Enter. Прошивка началась. Пока идет процесс нельзя вынимать кабель из телефона или компьютера.
Программа дает возможность перепрошить поэтапно все разделы или только некоторые:
- sуstem;
- cache;
- data;
- recovery.