Tool Android Debug Bridge (ADB) is an integral part of the ecosystem of development and advanced administration of mobile devices. This is a universal command line utility that allows your computer to interact with a smartphone or tablet based on Android. With its help, you can not only debug applications, but also perform complex system operations that are not available through the standard interface.

Many users are faced with the need to install this tool to unlock the bootloader, install custom recoveries, or remove system garbage. The setup process may seem confusing due to the abundance of disparate information on the Internet, but in fact the procedure is standardized. In this guide, we will walk you through each step, from downloading platform tools to successfully connecting the device.

The correct configuration of the development environment is critical for the stable operation of all subsequent commands. Errors at the stage of installing drivers or environment variables often lead to the fact that the computer simply โ€œdoes not seeโ€ the phone, even if the cable is working. Let's go through the entire setup step by step to eliminate possible problems.

Preparing for installation and downloading components

The first step is to download the official package Platform Tools from Google servers. This is the only reliable source that guarantees the absence of malicious code and the latest versions of utilities. It is not recommended to download ADB from third-party forums or file hosting services, as the versions there may be outdated or modified.

The package is an archive containing three main executable files: adb.exe, fastboot.exe and systrace.py. For Windows users, you must also take care of the availability of USB drivers, although in modern versions of Windows 10 and 11 they are often installed automatically when you first connect a debugging device.

โš ๏ธ Attention: Before starting any manipulations, be sure to back up your important data. Working with ADB provides a high level of access to the system, and an erroneous command can lead to loss of information or disruption of the OS.

After downloading the archive, it must be unpacked into a convenient directory. Experienced administrators often create a folder C:\platform-tools at the root of the drive to simplify navigation. The length of the path to the files should not contain Cyrillic characters or spaces, as this may cause errors in interpreting commands in the terminal.

Where can you find old versions of ADB?

If for some reason you need a specific version of the toolkit (for example, to work with very old Android 4.x devices), you can find them in the archives of the official Google repositories, but for 99% of tasks always use the latest stable version.

Activating debugging mode on the device

Even with the software installed on the computer, the connection will not be established until you enable it on the smartphone itself. This security measure prevents unauthorized access to data if the device is lost or connected to someone else's PC. You will need to activate the hidden menu for developers.

Go to the settings of your gadget and find the section About phone or About device. Find the item Build number (Build Number) and quickly click on it 7 times in a row. The system will inform you that you have become a developer, after which a new section will appear in the main settings menu For developers.

  • ๐Ÿ“ฑ Go to the menu For developers and find the switch USB debugging.
  • ๐Ÿ”Œ Connect your smartphone to the computer via a high-quality USB cable, preferably an original one.
  • โœ… A request for debugging permission with a key fingerprint will appear on the phone screen RSA - click OK.

The settings interface may differ depending on the manufacturer's shell. Devices Xiaomi or MIUI may require an additional SIM card and waiting for 7 days to unlock the bootloader, but for simple USB debugging, activating the toggle switch is sufficient. Make sure that the device's screen is unlocked at the time of connection, otherwise the computer can only recognize it as a drive.

๐Ÿ“Š For what purpose are you installing ADB?
Removing system applications
Unlocking the bootloader
Debugging your applications
Just wondering
Other

Setting environment variables in Windows

To run commands adb from any folder in the command line, and not just from the directory with tools, you need to set the path to them in system variables. This will save you from having to enter the full path to the file every time or copy executable files to the Windows system folder, which is a bad practice.

Open system properties through the Control Panel or the This PC context menu. Go to the section Additional system parameters and click the button Environment variables. In the โ€œSystem Variablesโ€ block, find the line Path and select it for editing.

Add a new element, specifying the full path to the folder where you unpacked the platform tools, for example C:\platform-tools. After saving the changes, open a new command prompt (cmd) and enter the command adb version. If the system displays the version number, then the configuration was successful.

Component Purpose Location
adb.exe Main client for communication with the device Folder platform-tools
AdbWinApi.dll API library for working on Windows Folder platform-tools
AdbWinUsbApi.dll USB interface driver for debugging Folder platform-tools
fastboot.exe Utility for firmware sections Platform-tools folder

In some cases, antivirus software may block the operation of ADB drivers, perceiving them as suspicious activity. If the command adb devices does not produce results, try temporarily disabling protection or adding the tools folder to exceptions.

๐Ÿ’ก

Use USB 2.0 ports instead of 3.0 if you experience an unstable connection. Some older controllers on motherboards work better with debugging protocols at a lower speed.

Instructions for macOS and Linux users

Owners of computers running macOS or distributions Linux are luckier: installation often comes down to using package managers. On macOS, you can use the utility Homebrewby running the command brew install android-platform-tools in the terminal. This will automatically download the files and set up the paths.

For Linux users (Ubuntu, Debian, Fedora), installation is also easy via the terminal. For example, in Ubuntu it is enough to enter sudo apt install adb fastboot. However, in order for the device to be detected without superuser rights (root), you need to create a rule for udev. This is a configuration file that tells the system how to handle connected USB devices from specific manufacturers.

Create the file 51-android.rules in the directory /etc/udev/rules.d/. Inside the file you need to write down the rules for your vendor using it Vendor ID. You can find out this identifier through the command lsusb when the phone is connected. After creating the file, you need to restart the udev service with the command sudo udevadm control --reload-rules.

โš ๏ธ Attention: In Linux, access rights to USB ports are strictly regulated. If you do not configure udev rules, the command adb devices will show the device as ???????????? no permissionsand you will have to run the terminal as root, which is not safe.

The functionality check is similar to Windows. Open the terminal, enter adb devices and confirm the key fingerprint on the smartphone screen. In the macOS environment, sometimes it is necessary to additionally install drivers for specific chipsets if standard kernel kexts do not pick up the device correctly.

โ˜‘๏ธ Checking the connection in Linux

Completed: 0 / 4

Diagnostics of connection problems

The most common situation is status unauthorized in the list of devices. This means that there is a physical connection, but the phone has not given the computer control rights. Check your smartphone screen: the dialog box asking for the RSA key may be hidden behind other applications or appear on a locked screen that you did not immediately unlock.

If the device appears as offline, the problem may lie in the cable or port. Try replacing the USB cable with a known good one that supports data transfer, not just charging. It's also worth trying a different USB port, preferably located directly on the motherboard rather than on the front panel of the case.

In Windows Device Manager, check to see if there are any unknown devices with a yellow exclamation mark in the list. If such a device is present when the phone is connected, it means the driver is not installed. In this case, you can manually update the driver by specifying the path to the file android_winusb.infwhich is located in the folder usb_driver inside the SDK package or a separately downloaded Google driver.

Sometimes a complete restart of the ADB server helps. To do this, enter two commands in sequence on the command line: first adb kill-serverto stop the background process, and then adb start-server. After that, run again adb devices to check the status.

๐Ÿ’ก

The "unauthorized" status is resolved only on the phone side (unlocking the screen and confirming the key), and the "offline" status most often indicates a problem with the cable or port.

Basic commands for checking functionality

After a successful connection, when the serial number and status are displayed in the list of devices device, you can begin testing the functionality. The most basic command adb shell opens an interactive Linux shell right on your smartphone. This confirms that the communication channel works both ways.

You can try running a simple command inside the shell, for example ls to view files or reboot to reboot the device (be careful). The shell is exited using the command exit. It is also useful to know the command adb reboot bootloader, which puts the phone into fastboot mode for firmware.

To transfer files, use the command adb push (download to phone) and adb pull (download from phone). The syntax is simple: adb push local_file remote_path. This allows you to quickly copy large amounts of data without using cloud storage or cables in drive mode.

โš ๏ธ Attention: Interfaces and terms of use of services may change. Always check the latest commands and capabilities with the official Android Developers documentation, since in new versions of Android some commands may be changed or blocked by the manufacturer.

Regular updates of platform tools guarantee compatibility with new versions of Android. Google releases ADB updates several times a year, adding support for new security protocols and fixing connection bugs. Monitor the version via the command adb version.

Frequently asked questions (FAQ)

Is it safe to enable USB debugging all the time?

Leaving debugging enabled all the time is not recommended, especially if you often connect your phone to public charging stations or unfamiliar computers. This creates a potential vulnerability. Turn on the mode only while performing necessary operations and turn it off immediately after they are completed.

Why does the computer see the phone, but ADB does not detect it?

Most likely, the phone is connected in the โ€œCharging Onlyโ€ mode. Pull down the notification shade on your phone, tap on the USB connection notification and select mode File transfer (MTP) or PTP. Sometimes switching between these modes helps to โ€œwake upโ€ the connection for ADB.

Can I use ADB without installing drivers?

In Windows 10 and 11, Google's universal drivers are often installed automatically. However, for specific devices (for example, some Huawei models or older smartphones), you may need to manually install proprietary drivers or a universal driver WinUSB via the device manager.

What to do if the adb command is not recognized as an internal command?

This means that the folder path platform-tools is not added to the environment variable Path. Either you forgot to save the changes to the variable settings, or you opened the command prompt before making the changes. Close the terminal and open it again, or specify the full path to the exe file.

Does ADB work over Wi-Fi?

Yes, starting from certain versions of Android, you can connect to the device over the network. To do this, you first need to connect your phone via USB, enter the command adb tcpip 5555, disconnect the cable and then connect with the command adb connect phone_IP_address. This is convenient for wireless debugging.