Utility. ADB (Android Debug Bridge is a powerful tool for interacting with Android devices, including Xiaomi, Redmi and Android smartphones. POCO. It can debug, unlock hidden functions, install custom firmware, or even restore bricks after a failed experiment. ADB often seems difficult due to the need to configure the environment, install drivers and understand the command line.
In this article, we will discuss everything you need to know about ADB Xiaomi, from basic installation to advanced use cases, learn how to connect your smartphone to a PC, unlock a bootloader, gain root rights, and use it. ADB to optimize the system without risking damage to the device, with particular attention to the specific features of the firmware MIUI, They often block standard commands. ADB.
If you've never worked with the command line, don't worry. We'll explain each step in detail, provide screenshots and video instructions (where necessary), and warn you of common errors. For power users, the article has sections on hidden commands. ADB Xiaomi, which is not officially documented.
What is ADB and why you need it Xiaomi owners
ADB (Android Debug Bridge is a tool from the Android package SDK, This allows you to control your Android device from a computer through USB Or over the web. For Xiaomi smartphones. ADB It is especially useful for several reasons:
- π Unlocking the bootloader is a must before installing custom firmware (for example, LineageOS or Pixel Experience).
- π οΈ Removing system failures β if the smartphone is stuck on the logo or does not respond to buttons.
- π Access to hidden settings β for example, enabling developer mode or disabling unnecessary system applications.
- π± Backup and recovery of data without root rights (via adb backup).
- π Overcoming restrictions MIUI β For example, removing ads or disabling forced updates.
No ADB Many Xiaomi operations are simply impossible, for example, even to install Google Camera (GCam) on some models requires pre-configuration through the use of a new model. ADB. In addition, the manufacturer actively blocks the debugging capabilities in new versions. MIUI, knowledge ADB It is the only way to regain control of the device.
It is important to understand that ADB It works at the system level, so incorrect commands can lead to data loss or firmware corruption.
Preparation: installation ADB and drivers for Xiaomi
Before connecting the smartphone to the PC, you need to install ADB-Tools and drivers for Xiaomi. Here's a step-by-step guide:
1.Installation of Platform Tools (ADB and Fastboot)
Googleβs official Platform Tools package contains all the necessary utilities. Download it from the Android developer website:
- π Go to the Android page. SDK Platform Tools.
- π₯ Download the archive for your OS (Windows, macOS or Linux).
- π Unpack the archive in a convenient folder (for example, C:\platform-tools).
- π§ Add a path to the folder to the environment variable PATH (easy to run commands from any directory).
To check the correctness of the installation, open the command line (Win) + R β enter cmd) and execute:
adb versionIf the team outputs a version ADB (For example, 1.0.41, the installation was successful.
2. Installation of drivers for Xiaomi
Without the right drivers, Windows wonβt recognize a smartphone in mode ADB. There are two options for Xiaomi:
- π Universal drivers ADB β They are suitable for most Android devices. Download them from Google.
- π± Official Xiaomi drivers β sometimes required for new models (for example, Xiaomi 13 or Redmi Note 12.
After installing drivers, connect your smartphone to your PC through USB-cable (preferably original) and select File Transfer mode (MTP). If Windows requests a driver, specify the path to the folder with the drivers installed.
βοΈ Preparation for work with ADB
3. Incorporation of debugging by USB Xiaomi
By default, debugging mode is disabled to activate it:
- Go to Settings. β The phone.
- Click 7 times on the MIUI version until you become a developer!
- Back to Settings β Additionally. β For developers.
- Activate options: Debugging by USB Unlocking OEM (necessary to unlock the bootloader) Disable the check MIUI (if)
After connecting to the PC on the screen of the smartphone will be a request for debugging permission - confirm it by ticking Always allow from this computer.
π‘
If the adb device command doesnβt show your smartphone, try reconnecting. USB-You can switch the cable, change the port, or reboot the device, sometimes it helps to disable the antivirus that blocks the device. ADB.
Basic teams ADB For Xiaomi, what can you do without root?
Even without superuser rights. ADB It allows you to do a lot of useful things. Here are the most popular commands for smartphones Xiaomi:
| Team team. | Description | Example |
|---|---|---|
| adb devices | Shows connected devices | adb devices List of devices attached 1234abcd device |
| adb shell | Opens the command shell on the device | adb shell x1:/ $ |
| adb install [path] | Set up APK-file | adb install app.apk |
| adb pull [way] | Copies a file from a device to a PC | adb pull /sdcard/DCIM/photo.jpg |
| adb reboot [mode] | Reboots the device to the specified mode (bootloader, recovery, fastboot) | adb reboot bootloader |
Xiaomi is especially useful for management-related teams MIUI:
- π΅ Disabling advertising in MIUI (requires root or magisk: adb shell pm uninstall --user 0 com.miui.analytics adb shell pm uninstall --user 0 com.xiaomi.midrop
- π Resetting settings MIUI Data free: adb shell pm clear com.miui.home
- π± Enabling hidden features (e.g. tablet mode on large screens): adb shell settings put global force_fsg_nav_bar 1
Please note: some teams may not work on newer versions. MIUI Because of Xiaomi's security policy, you need to unlock the bootloader or get root rights.
What if the ADB canβt see the device?
Unlock bootloader on Xiaomi via ADB
Unlocking the bootloader is a must-do step to install custom firmware, obtain root rights, or restore the device after a crash. Xiaomi officially allows unlocking, but the process requires confirmation through a Mi Account.
β οΈ Warning: Unlocking the bootloader erases all data on the device! backup important files before starting.
Step 1: Linking your Mi Account to your device
1. Go to Settings. β Xiaomi account and log in.
2. Enable data synchronization.
3. Go to Settings. β Additionally. β For developers β Mi Unlock status.
4. Click Add Account and Device.
β οΈ Note: Xiaomi can block unlocking if the account is new (less than 7 days) or the device is not tied to the account for more than 30 days.
Step 2: Installation of Mi Unlock Tool
1 Download the official Mi Unlock Tool utility.
2. Unpack the archive and launch it. miflash_unlock.exe.
3. log in under the same Mi Account as you do on your smartphone.
Step 3: Unlocking the bootloader
1. Turn off the smartphone.
2.Put Volume Down + Power to enter Fastboot.
3. Connect the device to the PC.
4.In Mi Unlock Tool, press Unlock.
5. Wait until the process is completed (usually takes a lot of time). 1-5 minute).
After unlocking the smartphone will automatically restart and perform a reset to factory settings.
π‘
Unlocking the bootloader on Xiaomi is only possible 1 time every 30 days for a single Mi Account. If you sell the device, first link it to a new account.
Getting root rights to Xiaomi through ADB Magisk
Root rights give you access to deep system setup, but they are not warranty and can disrupt some features (such as Google Pay or Banking applications).
Step 1: Install custom recovery (TWRP)
1. Download the official version TWRP For your model from twrp.me.
2. Rename the file to twrp.img And put it in a folder with platform-tools.
3. Transfer the smartphone to Fastboot mode (Loudness down) + Nutrition).
4. Follow the command:
fastboot flash recovery twrp.img5.Reboot to recovery:
fastboot reboot recoveryStep 2: Installation of Magisk
1. Download the latest version of Magisk from GitHub.
2. Move the file. Magisk-vXX.X.zip on a smartphone (for example, via adb push).
3.B. TWRP Choose Install β Find the way to the archive with Magisk.
4. After installation, restart to the system.
Check for root rights using the Magisk Manager app or command:
adb shell suIf the command returns # instead of $, So root is successfully obtained.
Step 3: Hiding root from applications (Magisk Hide)
Many banking apps and games (e.g, PokΓ©mon GO) They block the root devices:
- Open Magisk Manager.
- Go to Settings. β Magisk Hide.
- Check the boxes for apps that do not need to show root.
- Reset the device.
π‘
If the smartphone doesnβt boot after installing Magisk, try flashing stock firmware through the Mi Flash Tool, and then repeat the process with another version. TWRP.
ADB Recovery for Xiaomi after a failure
If the Xiaomi smartphone does not turn on, stuck on the logo or went to bootloop", ADB And Fastboot can help bring it back to life:
1. Fastboot Recovery (if the device doesn't boot)
If the smartphone does not respond to the power button, but is determined in Fastboot mode:
- Connect the device to the PC.
- Check for your team to have it:
fastboot devices- Download the stock firmware for your model from the Xiaomi Firmware Updater website.
- Unpack the archive and launch the Mi Flash Tool.
- Select Clean All mode and press Flash.
This method will delete all data, but will return the smartphone to working condition.
2. fixing bootloop through ADB Sideload
If the device is loaded into Recovery but cannot complete the system boot:
- Enter Recovery (Loudness Up + Nutrition).
- Select Apply Update β Apply from ADB.
- On PC, run a command to download the firmware:
adb sideload firmware.zipThis method saves user data, but requires official firmware in.zip format.
3. Reset password through ADB (If the pattern lock is forgotten)
If you forget the lock password, but debugging USB It was turned on earlier, you can throw it through ADB:
adb shell
rm /data/system/gesture.key
rm /data/system/password.key
rebootAfter the reboot, the password will be reset, but the application data may get damaged.
What if fastboot doesnβt see the device?
Hidden opportunities ADB Xiaomi: Optimization and Tweets
ADB It allows you to customize Xiaomi at a deep level, even without root. Here are some useful tweaks:
1. Disabling unnecessary system applications
MIUI It contains many pre-installed applications that cannot be removed by standard means. ADB They can be turned off (without removal):
adb shell pm uninstall -k --user 0 com.miui.analytics
adb shell pm uninstall -k --user 0 com.xiaomi.midrop
adb shell pm uninstall -k --user 0 com.miui.miserviceA complete list of packages can be obtained by the team:
adb shell pm list packages | grep 'miui'2.Including hidden animations and gestures
For example, to enable a return gesture (like on iPhone) on models without official support:
adb shell settings put global force_fsg_nav_bar 1To return the standard navigation bar:
adb shell settings put global force_fsg_nav_bar 03. Increased battery life
Disabling background activity for individual applications:
adb shell dumpsys deviceidle force-idleOr limiting the refresh rate of the screen (e.g., up to 60Hz for battery saving):
adb shell settings put global peak_refresh_rate 604 Unlocking Hidden Camera Functions
On some Xiaomi models, you can activate Pro Video mode or night mode for the front camera:
adb shell setprop persist.camera.HAL3.enabled 1After completing the command, restart the device.
π‘
Before using tweaks through ADB Make a backup of the data with the adb backup command -apk -obb -shared -all -f backup.ab. This will allow you to restore the system in case of failure.
Frequent mistakes when working with ADB Xiaomi and their solutions
Even experienced users face problems when working with ADB. Here are the most common mistakes and ways to fix them:
| Mistake. | Reason. | Decision |
|---|---|---|
| device unauthorized | Not confirmed request for debugging on the smartphone | Turn it off and plug it back in. USB, Confirm the request on the device screen |
| no devices/emulators found | Drivers are not installed or the cable is faulty | Check the connection, install drivers manually |
| fastboot: error: Failed to boot into fastbootd | The bootloader is blocked or damaged | Unlock the bootloader through the Mi Unlock Tool |
| adb: error: closed | USB-The port or cable does not support data transmission | Use the original cable and USB 2.0 port |
| This miui version cannot be... | MIUI block commands ADB because of security policy | Update your firmware or use Magisk to bypass restrictions |
β οΈ Note: If after completing the command ADB The smartphone stopped responding, don't panic. 10-15 Minutes - sometimes the system takes a long time to process changes. If the screen remains black, try forced reboot (Powering) + Volume up on 10 seconds).
Another typical problem β MIUI block ADB after the update:
- Go to Settings. β For developers.
- Turn it off and turn on the debugging again. USB.
- Confirm the PC request.