ADB Xiaomi: How to use it – from installation to hidden features

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.

πŸ“Š What do you plan to use for? ADB Xiaomi?
Unlocking the loader
Installation of custom firmware
Removal of advertising in MIUI
Recovery after failure
Other

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 version

If 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

Done: 0 / 5

3. Incorporation of debugging by USB Xiaomi

By default, debugging mode is disabled to activate it:

  1. Go to Settings. β†’ The phone.
  2. Click 7 times on the MIUI version until you become a developer!
  3. Back to Settings β†’ Additionally. β†’ For developers.
  4. 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.DescriptionExample
adb devicesShows connected devicesadb devices List of devices attached 1234abcd device
adb shellOpens the command shell on the deviceadb shell x1:/ $
adb install [path]Set up APK-fileadb install app.apk
adb pull [way]Copies a file from a device to a PCadb 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?
1. Check if the debugging is included USB developer-setting. 2. Try another one. USB-cable (preferably original). 3. Install drivers manually through Windows Device Manager. 4. Reboot your smartphone and PC. 5. If used macOS/Linux, Check the access rights to USB-devices (the lsusb command).

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.img

5.Reboot to recovery:

fastboot reboot recovery

Step 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 su

If 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:

  1. Open Magisk Manager.
  2. Go to Settings. β†’ Magisk Hide.
  3. Check the boxes for apps that do not need to show root.
  4. 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:

  1. Connect the device to the PC.
  2. Check for your team to have it:
fastboot devices
  1. Download the stock firmware for your model from the Xiaomi Firmware Updater website.
  2. Unpack the archive and launch the Mi Flash Tool.
  3. 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:

  1. Enter Recovery (Loudness Up + Nutrition).
  2. Select Apply Update β†’ Apply from ADB.
  3. On PC, run a command to download the firmware:
adb sideload firmware.zip

This 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




reboot

After the reboot, the password will be reset, but the application data may get damaged.

What if fastboot doesn’t see the device?
1. Try another one. USB-cable and port (preferably) USB 2.0). 2. Install drivers manually through Device Manager (select "Android Bootloader Interface"). 3. Some Xiaomi models require you to hold the Loudness button down for a period of time. 10-15 seconds after connecting to the PC. 4. If the device is completely dead (does not respond to charging), hardware repair may be required.

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.miservice

A 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 1

To return the standard navigation bar:

adb shell settings put global force_fsg_nav_bar 0

3. Increased battery life

Disabling background activity for individual applications:

adb shell dumpsys deviceidle force-idle

Or limiting the refresh rate of the screen (e.g., up to 60Hz for battery saving):

adb shell settings put global peak_refresh_rate 60

4 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 1

After 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 unauthorizedNot confirmed request for debugging on the smartphoneTurn it off and plug it back in. USB, Confirm the request on the device screen
no devices/emulators foundDrivers are not installed or the cable is faultyCheck the connection, install drivers manually
fastboot: error: Failed to boot into fastbootdThe bootloader is blocked or damagedUnlock the bootloader through the Mi Unlock Tool
adb: error: closedUSB-The port or cable does not support data transmissionUse the original cable and USB 2.0 port
This miui version cannot be...MIUI block commands ADB because of security policyUpdate 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:

  1. Go to Settings. β†’ For developers.
  2. Turn it off and turn on the debugging again. USB.
  3. Confirm the PC request.
Can I use ADB without unlocking the bootloader?
Yes, most teams. ADB work on a locked bootloader, except for operations related to changing system partitions (for example, firmware recovery or kernel). However, to obtain root rights or install custom firmware, unlocking is mandatory.
How to return a standard firmware after experiments with ADB?
Download the stock firmware for your model from the official Xiaomi or Xiaomi Firmware Updater website. Then run it through the Mi Flash Tool in Fastboot mode. Select the Clean all for full reset or Clean all and lock option if you want to lock the bootloader again.
Why doesn’t ADB see my Xiaomi device on macOS/Linux?
Nana macOS/Linux You need to set the udev rules for USB-Execute: echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666"' | sudo tee /etc/udev/rules.d/51-android.rules sudo udevadm control --reload-rules sudo udevadm trigger Then reconnect the device. For Xiaomi, the vendor ID (idVendor) is usually 2717, But it may be different for new models.
Can we do this? ADB louden?
Theoretically, yes, but it's risky -- you can damage the speaker. If you're ready to experiment, use the command: adb shell settings put global. volume_steps 30 However, it is better to use specialized applications such as ViPER4Android (Magisk demands).
How about ADB drop off MIUI forever?
Complete removal of ads requires root rights or modified firmware. Without root, you can disable some of the ad modules: adb shell pm uninstall --user 0 com.miui.analytics adb shell pm uninstall --user 0 com.xiaomi.midrop adb shell pm uninstall --user 0 com.miui.msa.global For complete removal, it is recommended to flash MIUI EU or xiaomi.eu - modified versions MIUI publicity.