How to Use ADB on Xiaomi: A Complete Guide with Teams and Tips

Android Debug Bridge (ADB) is a bridge between your computer and Xiaomiโ€™s smartphone that unlocks hidden system functions, unlocks the bootloader, installs custom firmware, removes bloatware, restores bricks after failed experiments, and automates routine tasks, but despite the toolโ€™s power, many users are afraid to touch it โ€” and in vain.

This article will debunk the myths about ADB complexity and show that itโ€™s easier to work with than it seems. Weโ€™ll figure out how to enable USB debugging on Xiaomi (including models on HyperOS), install the necessary drivers, learn how to send basic commands and solve typical problems โ€“ from the error of device unauthorized to the lack of response to adb devices. And youโ€™ll learn which three ADB commands can save a smartphone from the soft brick without losing data (spoiler: itโ€™s not just fastboot).

What is ADB and why you need it Xiaomi owners

ADB (Android Debug Bridge) is a console tool from Google built into the Android SDK. It allows you to control your device via the command line, bypassing the limitations of the standard interface. For Xiaomi, this is especially true for three reasons:

  • ๐Ÿ”“ Unlock bootloader. Without ADB, you can't get permission to install custom firmware (like LineageOS or Pixel Experience).
  • ๐Ÿงน Remove system applications. MIUI and HyperOS sin with preinstalled software (e.g. Mi Browser, Mi Video) that cannot be removed by standard methods.
  • ๐Ÿ› ๏ธ Recovery from crashes: If a smartphone is stuck on a logo or has gone into a bootloom, ADB is often the only way to bring it back to life.

But ADB is not just useful for advanced users, but it can also be used to:

  • ๐Ÿ“ฑ Transfer files to the device at USB 3.0 (faster than MTP).
  • ๐Ÿ”„ Automate application backup and data backup.
  • ๐ŸŽฎ Emulate screen taps to test games or automate actions.

โš ๏ธ Warning: ADB provides low-level access to the system. Wrong command can lead to data loss or buildup of the device. Always back up before experimenting!

Preparation: What you need to work with ADB on Xiaomi

Before you start, make sure you have:

ComponentRequirementsWhere to find it.
ComputerWindows 10/11, macOS or Linux. Windows will require administrator rights to install drivers.โ€”
USB cableOriginal cable from Xiaomi (or certified USB-C). Cheap cables may not support data transfer.Smartphone kit or accessories store
Platform ToolsThe latest version (at least 34.0.0 for HyperOS)Official Android website
Drivers.For Windows, Xiaomi USB Drivers or Google USB Drivers.Xiaomi website

If you are using Windows, download and install drivers before connecting your smartphone. For the macOS/Linux, no additional drivers are required, but you may need to configure the udev rules (instructions for Linux are given in the spoiler below).

Setting up udev for Linux
For the right job ADB On Linux, add a rule for Xiaomi: 1. Create a file. /etc/udev/rules.d/51-android.rules. 2. Add a line: SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666" (where 2717 โ€” vendor ID Xiaomi). 3. Follow the commands: sudo chmod a+r /etc/udev/rules.d/51-android.rules sudo service udev restart 4. Reconnect the device.

After installing Platform Tools, unpack the archive to the root of the C:\ drive (e.g., C:\platform-tools\). This will make it easier to access commands via cmd or PowerShell.

๐Ÿ“Š What OS do you use to work with ADB?
Windows
macOS
Linux
other

Step 1: Enable USB debugging on Xiaomi

On Xiaomi devices, the path to enabling debugging depends on the firmware version:

  • ๐Ÿ“ฑ MIUI 12โ€“14: Settings โ†’ About Phone โ†’ Version MIUI (click 7 times until the notification โ€œYouโ€™ve become a developerโ€ appears). Then go back to Settings โ†’ Additional โ†’ For Developers โ†’ Debugging on USB.
  • ๐Ÿ†• HyperOS: Settings โ†’ About Phone โ†’ HyperOS Version (also 7 taps). Next: Settings โ†’ Additional โ†’ Developer Settings โ†’ Debugging on USB.

Once activated, connect your smartphone to your computer and select the data transfer mode (Files or MTP). On the device screen, a request for debugging permission will appear - be sure to tick "Always Allow from this computer" and click Allow.

โš ๏ธ Warning: If the debugging request doesn't appear, check: Is the original cable connected (cheap cables often don't transmit data for debugging) is the driver installed (Device Manager shouldn't have exclamation points near Xiaomi) is the developer mode activated (sometimes reboot is required).

โ˜‘๏ธ Checking before connection ADB

Done: 0 / 5

Step 2: Check the connection and basic commands

Open the command line (cmd or PowerShell) and go to the folder with Platform Tools:

cd C:\platform-tools\

Run a command to check connected devices:

adb devices

If everything is configured correctly, you will see your Xiaomi serial number with device status. If it displays unauthorized instead, it means:

  • ๐Ÿ”„ You have not confirmed the debugging request on your smartphone (reconnect the device).
  • ๐Ÿ”‘ The RSA- key has changed on the computer (remove the adbkey.pub file in the.android folder in the user's home directory).

Now you can try simple commands:

Team team.DescriptionExample of inference
adb shellOpens the shell of the device (analogue of the terminal on the smartphone).redmi:/ $
adb pull /sdcard/DCIM/photo.jpg C:\Images\Copies photo.jpg file from device to computer.[100%] /sdcard/DCIM/photo.jpg: 1 file pulled, 0 skipped.
adb install app.apkInstalls the APK- file on the device.Performing Streamed InstallSuccess

๐Ÿ’ก

To avoid./adb or./fastboot every time, add the platform-tools folder to the PATH environment variable. Instructions for Windows: here.

ADBโ€™s Useful Teams for Xiaomi: From Unlocking to Recovery

Now, let's get to the practice. Below are the teams that Xiaomi owners will use 90 percent of the time.

1. Unlocking the bootloader (bootloader)

To install custom firmware or obtain root rights, you first need to unlock the bootloader. This is an official procedure, but requires an account binding Mi:

adb reboot bootloader


fastboot oem unlock

Once completed, the smartphone will restart and erase all data! Read more about unlocking in FAQ.

2. Removal of system applications (without root)

To remove unnecessary software (such as Mi Browser or Mi Music), first look for the name of the package:

adb shell pm list packages | grep "miui"

Then remove it (replace com.miui.browser with the desired package):

adb shell pm uninstall -k --user 0 com.miui.browser

The --user 0 flag removes the application only for the current user, without affecting the system.

adb shell cmd package install-existing com.miui.browser

3. reset of the pattern lock (if you forgot the password)

If you forgot the pattern lock or PIN- code, but debugging on USB was enabled before blocking, you can reset it without losing data:

adb shell rm /data/system/gesture.key


adb shell rm /data/system/locksettings.db




adb shell rm /data/system/locksettings.db-wal




adb shell rm /data/system/locksettings.db-shm




adb reboot

After the reboot, the lock screen will disappear.Warning: on newer versions of MIUI/HyperOS, this method may not work due to enhanced protection.

4.Recovery from "soft brick"

If the smartphone is getting stuck on the Xiaomi logo or went into a bootloom, try:

adb reboot recovery

If recovery is not available, go to fastboot and flash the stock firmware:

fastboot flash boot boot.img


fastboot flash system system.img




fastboot reboot

1. adb reboot recovery โ€“ transition to recovery for reset.

2. fastboot flash boot.img โ€“ recovery of the boot partition.

3. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img Disabling signature verification (relevant for Android) 10+).-->

Solving Typical ADB Problems on Xiaomi

Even with the right setup, ADB can be unstable, and here are the most common errors and solutions.

Mistake.Reason.Decision
device unauthorizedNo debugging request has been confirmed or the RSA- key has been reset.Remove adbkey.pub (see above) and reconnect the device.
no devices/emulators foundDrivers are not installed or the cable is faulty.Check Device Manager for errors. Try another USB cable/port.
adb: command not foundThe platform-tool folder is not added to PATH.Use the full path (e.g., C:\platform-tools\adb devices) or configure environment variables.
cannot stat 'file': No such file or directoryThe wrong path to the file (for example, when adb push).Check the file location or use the full path (e.g. adb push C:\app.apk /sdcard/).

If Xiaomi is not defined in fastboot (the fastboot team doesnโ€™t show anything), try:

  1. Switch to another USB-port (preferably USB 2.0).
  2. Press the button Volume down + Power for 10 seconds to force the transition to fastboot.
  3. Install drivers manually through Device Manager (select Android Bootloader Interface).

โš ๏ธ Warning: Some Xiaomi models (e.g. Redmi Note 12 or Xiaomi 13) require an unlocked bootloader to work with fastboot. If the device does not respond to commands, check lock status via fastboot oem device-info.

ADB over Wi-Fi: How to manage Xiaomi without cable

If you're tired of connecting your smartphone over USB, you can configure ADB over Wi-Fi.

  1. Connect the device via USB and do:
  2. Turn off the cable and find the IP- address of the smartphone in the Wi-Fi settings (e.g., 192.168.1.100).
  3. Connect to Wi-Fi:

Now all ADB commands will run wirelessly! To return the USB- mode, run:

adb usb

Please note:

  • ๐Ÿ”‹ The device and computer must be on the same Wi-Fi network.
  • ๐Ÿ”„ After the smartphone is restarted, you will need to re-run adb tcpip 5555.
  • โšก The data rate over Wi-Fi is lower than over USB 3.0.

alias adbconnect='adb connect 192.168.1.100:5555'

Now it is enough to enter adbconnect in the terminal.-->

FAQ: Frequent questions about ADB on Xiaomi

๐Ÿ”“ How to unlock a bootloader on Xiaomi via ADB?
1. Link your Mi Account to your device in Settings โ†’ Xiaomi Account โ†’ Mi Cloud. 2. Enable debugging using USB and connect to your PC. 3. Perform: adb reboot bootloader fastboot oem unlock 4. Confirm unlock on your smartphone screen (volume up button). โš ๏ธ Attention: Unlock erases all data! Also, Xiaomi can block the account for 72 hours after unlocking (anti-theft protection).
๐Ÿ“ฑ Can I turn ADB on if my smartphone is locked?
Not if USB debugging wasn't enabled before locking.The only options are: Recovery via Mi Account (if account is tied), Reset via fastboot (data loss), Contact Xiaomi Service Center with proof of purchase.
๐Ÿ”„ How to roll back the MIUI/HyperOS update via ADB?
1. Download the stock firmware for your model from Xiaomi. 2. Unpack the ZIP- archive and go to fastboot: adb reboot bootloader 3. Run all the sections in turn (example for Redmi Note 11): fastboot boot.img flashboot fastboot system system.img fastboot vendor vendor.img fastboot dtbo dtbo.img fastboot โš ๏ธ fastboot can not lead to the section.
๐Ÿ›ก๏ธ Is it safe to use ADB on Xiaomi?
ADB is secure in itself, but the risks depend on your actions: โœ… Safe: copy files, install APK, reset a pattern lock (if you're the owner). โš ๏ธ Risky: delete system files, firmware unofficial images, change the boot partition. โŒ Dangerous: commands like fastbootse erase userdata (erase all data without recovery). Always back up via adbup or PC Suite before experimenting.
๐Ÿ–ฅ๏ธ Can I use ADB on Mac or Linux?
Yes, the process is virtually the same as Windows: Install Platform Tools (see Preparation section). For Linux, configure udev rules (instruction in spoiler above). Use Terminal (Mac) or any terminal emulator (Linux). ADB and fastboot commands are identical for all OSes.