Debugging mode by USB on Xiaomi smartphones (including the Redmi line, POCO and Mi is a hidden feature for developers that allows access to advanced device settings through the computer, without activating it, you can not unlock the bootloader, flash custom software, get root rights or even transfer files through the computer. ADB (However, many users face problems: the debugging button is inactive, the PC does not see the device, or MIUI Blocking connection due to security policy.
In this article, you will find the most current ways to enable USB debugging on Xiaomi in 2026, including bypassing the MIUI restrictions, installing ADB drivers and solving common errors (for example, unauthorized or device offline). The instructions are adapted for the latest firmware versions β from MIUI 14 to HyperOS β and tested on Xiaomi 13/14, Redmi Note 12, POCO F5 and others. If you plan to sew your phone, unlock the bootloader or test software, this guide will help avoid common errors.
Why do you need to debug USB on Xiaomi?
USB debugging isn't just a "geek mode," it's required in a number of practical situations:
- π Unlocking the bootloader (bootloader) - a mandatory step before firmware custom recaveri (TWRP) or obtaining root rights through Magisk.
- π± Installation of the software through ADB: manual firmware update, system recovery after a failure or installation APK-Files without Google Play.
- π₯οΈ Debugging apps: If you are a developer, without this mode, it is impossible to test programs on a physical device through Android Studio.
- π Backup data with adb backup or tools like Titanium Backup (requires root).
- π οΈ Fault diagnosis: system logcat, sensor inspection or iron testing.
Without debugging enabled, even standard operations such as moving files over MTP (Media Transfer Protocol) may not work properly, for example, on some versions of the MIUI without activating this mode, Windows displays the device as "unidentified", and MacOS or Linux ignores the connection.
β οΈ Attention: Including debugging by USB This reduces the security of the device, and an attacker with physical access to the phone can use the device to ADB steal data, install malware or reset your password, turn off mode after work is done and don't connect your phone to public ones. USB-Ports (for example, airports or cafes).
Preparation of the smartphone: unlocking the "Developer's Parameters"
By default, the USB debugging option is hidden in the Developer Settings menu, which is blocked. To unlock it, follow the following steps:
- Open the Settings app on your Xiaomi.
- Go to About Phone (or About HyperOS Device)
- Find the MIUI Version (or Build Number) string and tap it 7 times in a row.
- After 4-5 taps, a notification will appear: "You are almost there!".
- At press 7, the system will say, βYouβve become a developer!β
Now, a new section will appear in the main Settings menu β Additional β Developer Settings (on HyperOS, the path may differ: Settings β System β Advanced Settings β For Developers). If the section does not appear, restart the device.
Step-by-step: how to enable debugging by USB
Once unlocked, we move to the main stage. Importantly, on some Xiaomi models (especially HyperOS), the debugging option can be blocked by the additional protection of MIUI Optimization. If the button is inactive, read the section on circumvention of restrictions below.
βοΈ Checklist before debugging is included
Incorporation algorithm:
- Go to Settings β Additional β Developer settings.
- Find the option debugging by USB (in English firmware - USB debugging).
- Activate the switch. You'll see a warning that says, "Let me debug over USB?" press OK.
- Connect your phone to your PC through the original USB-cable (preferably from the set).
- On the phone screen, you will see a request: "Do you allow debugging over USB from this computer?". Check the box Always allow from this computer and click Allow.
If an unauthorized error occurs (the device is not authorized) at this stage, follow the following steps:
1. Disconnect the cable from the PC.
2. On your phone, go to Developer Options and look for the option "Revoke USB Debugging Authorizations" (or "Revoke USB Debugging Authorizations").
3. Confirm the withdrawal of permits.
4. Reconnect the phone and repeat the authorization.Solution: Why is USB debugging not enabled?
Even after completing all the steps, Xiaomi users often encounter errors.
| Problem. | Reason. | Decision |
|---|---|---|
| The USB debugging button is inactive (grey) | MIUI Optimization or Data Protection is activated | Disable MIUI Optimization in Developer Settings or Add PCs to Trusted Devices in Settings β Memory β Data Protection |
| PC does not see the device (in adb devices empty) | There is no ADB driver or incorrect connection mode | Install Google USB drivers and select File Transfer (MTP) mode when connecting |
| Error device offline in ADB | Conflict with antivirus or energy saving USB-port | Disable the antivirus, check the power settings of the ports in Windows Device Manager |
| No authorization request appears | Adbd service failure or MIUI blocking | Reboot your phone and PC, then reconnect. If it doesn't work, run adb kill-server and adb start-server in the command line. |
Pay special attention to USB connection mode. On Xiaomi, the first time you connect to a PC, a notification appears with a choice of action: Charge, File Transfer, Photo Transfer or Midia Device (MIDI). To debug, be sure to select File Transfer (MTP) - otherwise ADB will not be able to establish a connection.
What if MIUI blocks debugging?
Installation of ADB drivers on a computer
To recognize a Xiaomi device in debugging mode, you need to install ADB drivers and Android platform tools. The process is different for Windows, MacOS and Linux:
For Windows:
- Download Android SDK Platform-Tools from Google.
- Unpack the archive in the folder C:\platform-tools.
- Install drivers: Open Device Manager. Find a Xiaomi device with a yellow exclamation point (usually under Other Devices). Update the driver manually, pointing the path to the folder platform-tools\usb_driver.
adb devicesYour device with device status should appear on the list.
For MacOS/Linux:
On these systems, drivers are not required, but you need to configure adb:
Install adb and fastboot on MacOS (via Homebrew)
brew install android-platform-tools
For Linux (Debian/Ubuntu)
sudo apt update
sudo apt install adb fastbootOnce installed, add the path to the platform-tools to the PATH environment variable or use the full path to the commands (e.g., ~/platform-tools/adb devices).
π‘
If adb devices show unauthorized, but the request does not appear on the phone, try changing the phone. USB-Cheap cables often don't support data transmission, just charging.
Bypassing MIUI restrictions: if debugging is blocked
Since MIUI 12, Xiaomi has tightened security policies, and on some devices, USB debugging can be blocked even after activation.This is due to the MIUI Optimization feature, which restricts access to system settings.
- In Developer Settings, find the MIUI Optimization option (or MIUI Optimization) and turn it off.
- Reset the device.
- Re-enable USB debugging β now the option should be active.
If MIUI Optimization is not available (e.g. on HyperOS), try an alternative method:
1. In "Developer Settings" include "Unlock OEM" (OEM Unlocking).
2. Connect the phone to the PC and execute the command:
adb shell settings put global oem_unlock_enabled 1
3. Reset the device.On Chinese firmware (China ROM), you may need to link your Mi Account to your device.
- Go to Settings β Xiaomi Account and log in.
- In Developer Settings, find the Mi Unlock Status option and link the device to your account.
- Wait 72 hours (Xiaomiβs requirement to unlock the bootloader).
π‘
If USB debugging is needed to unlock the bootloader, after successful verification (adb devices) immediately link the Mi Account to the device via the Mi Unlock Tool. Xiaomi can block the ability to unlock if more than 30 days pass between activating the debugging and using the tool.