What is ADB and why you need it Xiaomi owners
Android Debug Bridge (ADB) is a bridge between your Xiaomi smartphone and your computer that allows you to access hidden features, install custom firmware, remove embedded apps (bloatware), recover data after a crash, or even unlock the bootloader for advanced customization, but before you use ADB, it needs to be activated correctly β and on devices with MIUI, this process has its nuances.
Owners of Redmi, POCO and other Xiaomi lines often face problems when connecting to ADB: the system can block access, require additional permissions or not recognize the device at all. In this article, we will analyze all the steps from enabling debugging over USB to solving typical errors, including working with a locked bootloader and features of the latest versions of MIUI 14/15.
Important: ADB gives you complete control of the system, so careless actions can lead to data loss or βbrickingβ of the device. If you are a beginner, we recommend that you first learn the basic commands and create a backup through adb backup.
Preparation of the smartphone: enabling debugging by USB
The first step is to unlock access to the developerβs settings and enable debugging. On Xiaomi, this process is slightly different from standard Android because of the proprietary MIUI shell.
- Activate Developer Mode: Go to Settings β About Phone β MIUI Version and press it 7 times in a row until the notification βYouβve become a developerβ appears. Some models (e.g. POCO F5) may require you to enter a pattern lock.
- Turn on USB debugging: Return to the main settings menu, find a new section Additional β Developer (or Settings β System β Advanced Settings β Developer on MIUI 15). Activate the USB debugging switch.
- Allow debugging for your PC: When you first connect to your computer, an RSA request will appear on your smartphone screen. Be sure to tick "Always Allow from this computer" and click "Allow." If you don't, access to ADB will be blocked every time you connect.
β οΈ Note: On some models (Xiaomi 13 Ultra, Redmi Note 12 Pro)+) After debugging is enabled, you may need to unlock the bootloader through the official Mi Unlock tool. ADB It will work with restrictions (for example, root access is not possible).
If the For Developers section suddenly disappeared after the MIUI update, try resetting the application settings: Settings β Applications β Application Management β Three Points β Reset application settings.
Install ADB on your computer: Windows, macOS, Linux
To connect to a smartphone, the PC must have ADB drivers and the tool installed, a process that varies depending on the operating system.
For Windows.
1. Download Googleβs Platform Tools (official package with adb.exe and fastboot.exe).
2. Unpack the archive in the root of the C:\ disk (e.g., C:\platform-tools\).
Install the drivers:
- π Connect your smartphone to your PC in File Transfer (not Charging) mode").
- π₯οΈ Open Device Manager, find Xiaomi with a yellow exclamation point.
- π₯ Right-click. β Update the driver β Perform a search on this computer β point the way to the folder platform-tools\usb_driver.
For macOS/Linux
Drivers are not required on these systems, but you need to add adb to the environment variables:
# For macOS (via Terminal)
brew install android-platform-tools
For Linux (Debian/Ubuntu)
sudo apt update && sudo apt install adb fastbootAfter installation, check the connection with the command:
adb devicesIf the device appears in the serial number list, the connection is successful. If not, restart the smartphone and PC, then try again.
π‘
If the adb device command returns a blank list, try switching USB connection mode on your smartphone: Settings β Connection and Sharing β USB Mode (select File Transfer or MTP).
First ADB Connection: Checking and Basic Commands
Now that the smartphone and PC are ready, we can get to work with ADB. Let's start by checking the connection and the main commands.
Step 1. Check the connection
Open the command line (Windows) or terminal (macOS/Linux) in the folder with the platform-tools and type:
adb devices -lIf everything is set up correctly, you will see something like:
List of devices attached
a1b2c3d4e5f6 device product:tissot model:Redmi_Note_7 device:tissotStep 2. Basic commands ADB
| Team team. | Description | Example |
|---|---|---|
| adb shell | Opens the shell of the device to execute Linux commands | adb shell ls /sdcard/ |
| adb pull | Copies files from a smartphone to a PC | adb pull /sdcard/DCIM/photo.jpg C:\Images\ |
| adb push | Uploads files from PC to smartphone | adb push app.apk /sdcard/Download/ |
| adb install | Set up APK-file | adb install com.example.apk |
| adb reboot | Reset the device in the specified mode | adb reboot bootloader (for fastboot) |
β οΈ Note: Adb shell su or adb root commands will not work on Xiaomi without first obtaining root permissions. This requires unlocking the bootloader through the Mi Unlock Tool and installing custom recovery (for example, custom recovery, TWRP).
On devices with MIUI 14+, the adb backup command may not work due to manufacturer limitations, in which case use alternative backup methods, such as through Mi PC Suite or third-party applications.
Is the smartphone connected in the mode "File transfer"?|Are drivers installed (for Windows)?|Is the device visible in the list after the command adb devices?|Is debugging permitted USB developer-setting?-->
Solving typical mistakes ADB Xiaomi
Even when you set it up properly, users often encounter errors, and let's look at the most common ones and how to fix them.
1. "Unauthorized" or "Device not found"
Reason: The smartphone didnβt give permission to debug or the RSA key was reset.
Decision:
- π Turn it off and plug it back in. USB-cable.
- π± On your smartphone, go to Settings β For developers and revoke permissions USB-Debugging (option "Revoke permissions").
- π₯οΈ On PC, delete the adbkey.pub file in the folder %USERPROFILE%\.android\ (Windows or ~/.android/ (macOS/Linux), Then reconnect.
2. "No permissions" when working with files
Reason: MIUI blocks access to system folders through ADB.
Decision:
- π§ Use the command adb shell, then su (requires root).
- π To access /data or /system You may need a Magisk or custom firmware.
- π± Check if the Data Protection mode is activated in Settings β Confidentiality.
3.ADB works, but not all commands are executed
Reason: MIUI restrictions for unlocked devices.
Decision:
- π Unlock the bootloader via Mi Unlock Tool (requires Mi Account binding and waiting) 7-168 hours).
- π² Install. TWRP To circumvent restrictions (instructions depend on the model).
- π Try using adb shell pm list packages to check available features.
What if ADB doesnβt see the device after the MIUI update?
Alternative ways to connect to ADB without cable
If USB-The port of the smartphone is damaged or you prefer a wireless connection, you can use it. ADB via Wi-Fi or LAN. This method works for most Xiaomi devices with MIUI 12 and newer.
Step 1. Connect to USB and switch ADB to network mode:
adb tcpip 5555Step 2. Turn off the cable and connect via IP:
Find out locally. IP-Smartphone address in Wi-Fi settings, then enter:
adb connect 192.168.1.100:5555Replace 192.168.1.100 with your deviceβs current IP.
Step 3. Check the connection:
adb devicesIf you have an IP-addressed device on the list, you're successful, and you can now use ADB without cable while your smartphone and PC are on the same network.
β οΈ Note: Wireless connectivity is less stable than USB. When a communication breaks (for example, when you reboot the device), you will need to re-run adb connect. To work constantly, add a command to autoboot or use scripts.
On some models (POCO X5 Pro, Xiaomi 12T) after the reboot, port 5555 resets, in which case you will have to temporarily connect to USB and repeat adb tcpip 5555.
π‘
Wireless ADB is convenient for debugging applications or transferring files, but is not suitable for critical operations (for example, firmware via fastboot).
Unlock the bootloader for full access to ADB
By default, the Xiaomi bootloader is locked, which limits the capabilities of ADB. For example, it is impossible to:
- π§ Install custom recovery (TWRP).
- π¦ Get root access through Magisk.
- π Switching unofficial firmware (for example, LineageOS).
Step 1. Link your Mi Account to your device:
Go to Settings β Xiaomi Account β Mi Cloud and log in. Make sure the device is linked to your account (check Settings β About Phone β Mi Status).
Step 2. Download the Mi Unlock Tool:
The official tool is available on Xiaomi's website, install it on your PC and log in under the same account as your smartphone.
Step 3. Unlock the bootloader:
- Turn off your smartphone and press Volume Down + Power to log into fastboot.
- Connect the device to your PC and start the Mi Unlock Tool.
- Click Unlock and wait until it is completed (it may take up to 168 hours to wait for new accounts).
After unlocking, you will be able to:
- π₯ Install TWRP Fastboot Flash Recovery twrp.img.
- π§ Get root with Magisk (please stitch in) Magisk.zip recovery).
- π Stripping custom kernels or firmware.
On devices with MIUI 15 and newer, Xiaomi has tightened its unlock policy, and now some models (such as Xiaomi 14) require an application to unlock through the official website, stating the reason.