Have you ever faced a situation where you need to get full control of a Xiaomi smartphone, but standard settings do not give you this opportunity? Or wanted to install custom firmware but didnβt know where to start? Here comes ADB, a powerful tool that unlocks the hidden features of Android. If you are the owner of a Redmi device, POCO or Mi, this article will help you understand what ADB is for Xiaomi, how to enable it and what tasks it solves.
Many users mistakenly think that Android Debug Bridge is only for developers, but it's actually a universal tool for diagnosing, debugging, and even restoring smartphones, which can remove pre-installed apps, unlock the bootloader, install modified firmware, or simply copy files when the phone isn't responding, but it's important to understand that improper use of ADB can lead to a device blink. So, before experimenting, you should carefully study all the nuances.
What is ADB and how does it work with Xiaomi?
ADB (Android Debug Bridge is a command interface that allows you to control an Android device from a computer through a computer. USB For Xiaomi, this tool is especially important because the manufacturer often blocks certain features in the standard interface. MIUI. Like, no. ADB It is impossible to remove system applications or unlock the bootloader on new models.
The way it works is simple: you run an ADB server on your computer, which communicates with the adbd demon on your smartphone. All commands are sent through the console and the results are displayed in text form. It's like working with Terminal on Linux, but it's tailored to Android. It's important for Xiaomi that ADB supports unique commands, like managing Bootloader unlock or working with Fastboot.
- π§ Debugging applications β developers use ADB for testing software in real time.
- π± File Management β Copying, deleting or editing system data without rooting.
- π Unlocking the bootloader is a mandatory step before firmware custom ROM Xiaomi.
- π οΈ System recovery β if the smartphone is getting stuck or not turned on, ADB It might help bring him back to life.
However, there are limitations, such as the new Xiaomi 13/14 and Redmi Note 12 models, which have some ADB commands blocked by default due to MIUI security policy, requiring additional setup or even unlocking the Bootloader.
Why you need ADB owners Xiaomi: 5 real examples
Theoretical knowledge is good, but letβs look at the specific challenges ADB is solving on Xiaomi devices, and these examples will show why itβs worth mastering this tool, even if youβre not a developer.
The first and most popular case is the removal of embedded applications. MIUI is known for an abundance of pre-installed software (e.g. Mi Browser, Mi Music, Mi Video) that cannot be removed by standard means.
adb shell pm uninstall -k --user 0 com.miui.browserYou can get rid of unnecessary programs without root rights, which will free up memory space and speed up the system, but beware: removing system components (such as com.android.phone) can lead to a blink!
- π Acceleration of animation - Adb shell settings put global window_animation_scale 0.5 Reduces delays when switching between screens.
- π Resetting the pattern lock β if you forget the password, ADB Helps remove gesture.key file (requires enabled debugging!).
- π‘ Network settings β changing Wi-Fi or Mobile Data settings through the console when the menu is not available.
- π§ Installation APK on locked devices β the adb install command app.apk It works even if the screen is not responding.
- π Unlocking the bootloader is the first step to install TWRP or LineageOS.
On Xiaomi models with MIUI 14 and later, some ADB commands require confirmation on the smartphone screen even if debugging is enabled.This is a security measure that cannot be turned off without unlocking the bootloader.
How to enable debugging by USB on Xiaomi: step-by-step instructions
Before you use ADB, you need to activate USB debugging in the developer settings. On Xiaomi, this process is slightly different from other brands because of the features of MIUI. Follow the instructions carefully so that you do not miss important steps.
First, open Settings and go to About Phone. Find the MIUI version and tap it 7 times in a row. Then the notification will appear: "You became a developer!". Now go back to the main settings menu, there will be a new item for developers (or additional β For developers on some models).
Find the "About the Phone" section in the settings
Stick 7 times on the MIUI version
Return to the main settings menu
Open "For Developers"
Insert "Debugging by USB"
Confirming permission on the computer-->
In the menu for developers, find the option Debugging by USB And you activate it. When you first connect to your computer, you'll see a confirmation request on your smartphone screen. RSA-Always check the key print β if it doesn't match what you'd expect, it could be a sign of an attack!
β οΈ Note: Some Xiaomi models (e.g. Redmi Note 11 Pro)+) When you turn on debugging, you need to restart. Without it, the computer may not recognize the device in the debugging system. ADB.
| Xiaomi model | Features of ADB inclusion | Do I need to unlock the Bootloader? |
|---|---|---|
| Xiaomi 13/13 Pro | Additional confirmation when connecting | Yes, for extended teams. |
| Redmi Note 12 | Debugging is disabled after restarting (MIUI bug 14) | No, for base teams. |
| POCO F5 | You need to turn on "Allow OEM-unlock" | Yeah, for firmware. |
| Xiaomi Pad 6 | Debugging only works through the original cable. | No. |
Install ADB on your computer: Windows, macOS and Linux
To use ADB, you need to install it on your computer. The process varies depending on the operating system. Windows is the easiest to use Google's official Platform Tools package, while macOS and Linux are the best to install through a package manager.
On Windows, download the Platform Tools archive from the Android Developers website. Unpack it to the root of the disk. C:\ (for example, C:\platform-tools\). Then add the path to the folder to the environment variable. PATH:
- Open the Control Panel β System β Additional System Parameters.
- Click Environment Variables β Select Path β Change.
- Add a new line with the path C:\platform-tools\.
- Save the changes and restart the computer.
To check the work, open the Command Prompt and enter:
adb versionIf you set it up correctly, you'll see the ADB version. On macOS, it's even easier to install it, just execute the command:
brew install android-platform-toolsAnd for Linux (Debian/Ubuntu):
sudo apt install adb fastbootβ οΈ Note: On Windows, antiviruses (such as Avast or Kaspersky) can block adb.exe as a potentially dangerous file. Add the platform-tools folder to exceptions, otherwise commands will not be executed.
π‘
If ADB Can't see the device, try changing it. USB-Xiaomi cables are cheap β they often donβt support data transfer.
The main ADB teams for Xiaomi: cheat sheet for beginners
Now that everything is set up, it's time to learn the basic commands, which will be useful for diagnosing, copying files, and managing the system, and below are the most useful explanation commands adapted for Xiaomi.
| Team team. | Description | An example for Xiaomi |
|---|---|---|
| adb devices | Shows connected devices | List of devices attached1234abcd device |
| adb shell | Opens the shell on the device | redmi:/ $ |
| adb pull /path/to/file | Copying a file from phone to PC | adb pull /sdcard/DCIM/Camera/photo.jpg |
| adb push file /path/on/device | Copies a file from a PC to a phone | adb push app.apk /sdcard/Download/ |
| adb install app.apk | Set up APK-file | adb install com.example.app.apk |
For Xiaomi, MIUI management teams are especially useful:
- π΅ Turn off the adverts in MIUI (requires root: adb shell pm disable-user --user 0 com.miui.daemon
- π The battery status of the adb shell dumpsys battery
- π‘ Turn on/off Wi-Fi: Adb shell svc wifi enable/adb shell svc wifi disable
On Xiaomi with MIUI 14, the adb backup team is not working properly due to manufacturer limitations. Use alternative methods such as TWRP to back up.
How to find out the full list of ADB commands?
Unlock Bootloader on Xiaomi via ADB and Fastboot
One of the most popular features of ADB for Xiaomi is Bootloader unlocking, which is necessary for installing custom firmware (LineageOS, Pixel Experience), obtaining root rights or restoring a device through TWRP. However, the process has become more difficult since Xiaomiβs security policy tightened in 2023.
First, you need to link your Mi Account to your device.
- Turn on Debugging. USB and Permit. OEM-unlocking in the settings for developers.
- Connect your smartphone to your computer and confirm debugging.
- Enter the command: adb reboot bootloader
- After restarting in Fastboot mode, run: fastboot oem unlock
Newer models (Xiaomi 14, Redmi Note 13) will require additional confirmation via the Mi Unlock Tool app. Download it from the official website and follow the instructions. Note: unlocking erases all data from the device!
β οΈ Note: Xiaomi limits the number of unlocks for one account. If you exceed the limit (usually 1 device per month), you will have to wait or use another Mi Account.
π‘
Unlocking Bootloader voids Xiaomi warranty. If you plan to contact the service center, return the device to its original state using the command fastboot oem lock.
Frequent mistakes when working with ADB on Xiaomi and how to fix them
Even experienced users sometimes face problems when working with ADB. Letβs consider the most common mistakes on Xiaomi and how to solve them.
- π« "Device unauthorized β device not authorized. Solution: Disconnect and reconnect the cable, confirm debugging on the smartphone screen.
- π "No devices found" β ADB Solution: Check the cable, drivers (on Windows) or reboot both devices.
- π "Command Not Allowed β Team Blocked MIUI. Solution: Unlock Bootloader or use alternative methods.
- π΅ "Offline" in the list of devices. Solution: Restart the server ADB Adb kill-server command, then adb start-server.
Another common problem is hanging out in the "Waiting for device" phase, which happens if:
- No drivers are installed (download Mi PC Suite).
- Use a non-original cable (try the cable from the kit).
- The developer settings are debugging disabled (check again).
On models with MIUI 14+, you can see a "More than one device" error even if you have one device connected.
adb devices | head -n 1 | awk '{print $1}' | xargs -I {} adb -s {} shell