ADB devices: driver installation, command list, use

Many owners of smartphones and tablets running Android, know that all such devices initially have the ability to fine-tune, manage devices or install applications that require superuser (root) rights. Often, expanding the functionality, not to mention getting root rights, directly on the device is impossible because of the blocking of the same bootloader. In this situation, installing a special ADB environment, sometimes called ADB Devices for Android, will help (although this is incorrect). Moreover, it must be installed on a computer or laptop, and after installation it will be possible to control your smartphone or tablet without directly executing all kinds of commands on the devices themselves. Next, we consider issues related to how to install ADB using several basic techniques, which commands are used to perform certain operations, and what is needed for the proper functioning of this applet.

What is ADB?

ADB is a special package of Android Debug Bridge, which is a kind of bridge between the computer and the mobile device in the form of a console application that works like a command line, but uses several other commands.

Principle of operation of ADB




The use of this environment allows you not only to gain full control over your device, but also to install programs, debug and unlock the device, and is also very often used at the initial stage when obtaining root rights, even with the installation of various recovery environments like TWRP and CWM or SuperSU controlling application, which cannot be done on an “unblocked” device in any other way. As you might have guessed, the adb devices command for Android is the main one, because it is it that allows you to establish a connection between a mobile device and a computer. The remaining teams are built on its basis. We’ll talk about them later, but for now let’s dwell on some of the nuances of the installation and the necessary conditions for this environment to work.





Install ADB and Fastboot bundled with Android SDK

ADB and Fastboot packages should preferably be paired. This is necessary for the reason that when the device is booted in Fastboot mode, the adb devices command with the associated attributes will not work (the device simply will not accept it), but similar Fastboot commands designed specifically for this mode can cope with the duties assigned to them very much not bad.

You can install ADB using several methods, among which the most cumbersome, but very often recommended, is the installation of the Android SDK (not to be confused with the more extensive Android Studio), the installation distribution of which can be downloaded directly from the official website of the developer. Installing only the SDK is recommended because the whole studio, unless you are developing applications for Android, you do not need. And it takes up decent hard drive space. If only the SDK is downloaded, you also need to install the JDK Java package, which can also be downloaded from the official site by choosing your operating system and the desired architecture.

Installing additional components in the Android SDK manager




After installing the package with the required bit depth, launch the SDK (executable file with the name Android), and in the window of the manager that appears, point to the additional installation options for Android SDK Platform Tools and Google USB Driver, and then click the package installation button.





At the end of the installation, the necessary tools will be located in the folder with the installed platform plug-ins.

Additional drivers and conditions for using ADB

Even for the first use of the adb devices command and all its possible combinations, you need to make sure that the so-called USB debugging mode is enabled on the mobile device. If it is deactivated or there is no such item at all in the device’s menu, first you need to find the section “About phone” or “About tablet” in the settings, tap the item 10-15 times, after which it will be reported that you have become a developer.

Enabling USB debugging mode




Having entered the appropriate menu "For Developers" and you can enable the necessary mode.

As for the drivers, quite often with the software from Google you can observe serious problems, since the driver may simply not work. In this case, it is strongly recommended that you install the software that is most suitable for your model by downloading it from the Internet resource of the equipment manufacturer. Sometimes it helps to install universal drivers. For example, a universal driver from Intel has recently become very widespread, but it is only necessary to install it if your device works on a processor of this particular manufacturer.

Starting ADB via command line or PowerShell

When all the components are installed, you need to connect your device to a computer or laptop and call the command line as administrator. First of all, it is necessary to go to the folder with the platform tools, which was mentioned above. For example, you installed the entire package in the Android directory on the “D” drive (in general, you don’t need to hide the necessary folders deeply, since you will have to enter absolute paths to them for a very long time). In the console, enter the transition command cd d: \ Android \ platform-tools, then press the enter key.

Command to connect to adb devices




Now enter the desired adb devices command and wait for the system to respond to the connected device. If the connection is established, the List of devices attached line will appear on the screen, indicating the serial number of the connected device and its status status (online or offline). The console operates in client-server mode, during which a virtual server (demon) is created during the data exchange, so do not be alarmed if you encounter such a mention somewhere or sometime. This is not a virus!

You can also install and run the console with the initial adb devices command using the PowerShell tool. To do this, just go to the platform-tools folder, and select "Run PowerShell here" in the RMB menu. But it’s just that the environment will not start functioning (it will be reported that no such commands are provided), therefore, to activate it, enter the line sdkmanager platform-tools in PowerShell, putting the attribute “./” (without quotes) before the main command.

How to create a Devices.cmd .adb file and launch the console through the command line?

In order not to constantly deal with transitions to the necessary folders, you can do much easier by creating a command line file in Notepad for a quick start.

Creating the Devices.cmd File




Enter the contents shown in the image above, save the file directly in the ADB directory, select “All types” as the format and manually add the CMD extension after the name. After that, it remains just to run the file for execution on behalf of the administrator.

Using only the core ADB package

By and large, if you have the driver necessary for connecting the device, you do not need to install the SDK and JDK. To simplify working with adb devices commands on the Internet, you can only download the archive with the necessary environment files, and then unpack them to a convenient place.

Starting the console from the Start.exe file




As a rule, in the final directory with ADB, the Start.exe file will be present, which is responsible for starting the command console from the location where the main ADB set is saved.

Adb devices command and related attributes

As for the main tools, a list of the most frequently used and necessary commands for the user for all occasions is given below.

List of basic ADB commands




The most significant are the commands to establish communication, reboot the device in bootloader mode (adb reboot bootloader), install software from a computer (adb sideload), etc. In general, you can enter the adb -help command in the console and get a complete list with all the attributes and examples of use.

Using the ADB Run Package

But for many novice users who do not understand the intricacies of using such tools, you can advise using the unofficial set of ADB Run. After unpacking the archive, the program needs to be installed, after which the environment can be launched directly from the “Desktop”.

Alternate ADB Run Package




It is somewhat different from what you can see on the command line, but the user does not need to enter the commands on their own, but simply enter the number corresponding to a particular operation and press the enter key. Along the way, from the downloaded kit, if required, you can install a special ADB driver, as well as use the additional portable utility ApkInstaller if you plan to install applications from a computer to a mobile device.

Mobile device management in Fastboot mode

In Fastboot mode, usually triggered by long pressing and holding the power buttons and lowering the volume, Android does not respond to adb devices commands. This is understandable, because the operating system is not yet loaded.

Fastboot boot menu




If you want, this mode represents something very vaguely reminiscent of the BIOS on the computer and is mainly used to create backups or restore the device’s health if the system does not boot at all. Also in this mode, you can install custom firmware, change the recovery environment Recovery, etc. The commands used are very similar to those used in ADB, but with the difference that the adb shortcut is not entered first, but the fastboot mode is specified (for example, for recognition of the device, the string fastboot devices is applied). In addition, it is in this mode that the bootloader can be unlocked if other means cannot do it (fastboot oem unlock).

Possible errors and ways to fix them

But some users often complain that the described tools do not work. The most common error is considered to be a crash where a message like adb devices unauthorized appears. How to fix the situation? The notification informs that the device is not authorized, so try reconnecting the device via USB. If this does not help, look at the USB debugging mode on the device itself. If “Charging only” is checked there, change it to MTP (Media Transfer Protocol), which automatically activates the ability to receive / transmit data. Sometimes the wrong driver may be a possible cause of the error, so you should either reinstall it or update it. But it’s better not to search for some universal driver, but to install software for a specific model of a mobile device by downloading it from the official website of the device manufacturer.




All Articles