How to enable USB debugging on Xiaomi: A complete guide to error solutions

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:

  1. Open the Settings app on your Xiaomi.
  2. Go to About Phone (or About HyperOS Device)
  3. Find the MIUI Version (or Build Number) string and tap it 7 times in a row.
  4. After 4-5 taps, a notification will appear: "You are almost there!".
  5. 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.

πŸ“Š What version? MIUI/HyperOS use?
MIUI 14
HyperOS (2026)
MIUI 13 or older
I don't know.

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

Done: 0 / 4

Incorporation algorithm:

  1. Go to Settings β†’ Additional β†’ Developer settings.
  2. Find the option debugging by USB (in English firmware - USB debugging).
  3. Activate the switch. You'll see a warning that says, "Let me debug over USB?" press OK.
  4. Connect your phone to your PC through the original USB-cable (preferably from the set).
  5. 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 activatedDisable 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 modeInstall Google USB drivers and select File Transfer (MTP) mode when connecting
Error device offline in ADBConflict with antivirus or energy saving USB-portDisable the antivirus, check the power settings of the ports in Windows Device Manager
No authorization request appearsAdbd service failure or MIUI blockingReboot 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?
On some firmware (especially Chinese) Xiaomi completely blocks debugging. USB Solution: 1. Install the official global firmware through the Mi Flash Tool. 2. Use alternatives ADB-drivers with a digital signature Xiaomi. 3. In extreme cases - unlock the bootloader and thread custom software (for example, LineageOS), where the restrictions MIUI absent.

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:

  1. Download Android SDK Platform-Tools from Google.
  2. Unpack the archive in the folder C:\platform-tools.
  3. 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 devices

Your 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 fastboot

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

  1. In Developer Settings, find the MIUI Optimization option (or MIUI Optimization) and turn it off.
  2. Reset the device.
  3. 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.

  1. Go to Settings β†’ Xiaomi Account and log in.
  2. In Developer Settings, find the Mi Unlock Status option and link the device to your account.
  3. 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.

Frequent Questions (FAQ)

Can you enable debugging over USB without accessing settings (for example, if the phone is locked)?
No, if the device is locked with a password/pattern lock and the Developer Settings were not unlocked in advance, you can't activate debugging. The only way out is to reset the phone to factory settings via Fastboot (you'll need an unlocked bootloader) or use service codes (e.g. ##4636#), but they don't give you access to debugging.
Why did the USB debugging stop working after the MIUI update?
Xiaomi regularly tightens security policies. After upgrading to MIUI 14/HyperOS, you may need to: Reverse USB debugging authorizations. Disable MIUI Optimization in developer settings. Reinstall ADB drivers on your PC. If nothing helps, reset (without deleting data) through Settings β†’ System β†’ Reset.
How to enable USB debugging on Xiaomi with a damaged screen?
If the screen doesn’t respond to touch, but the device turns on, connect it to the PC and use the mouse through the device. USB OTG (You need an adapter. Next, plug in. OTG-You can use your mouse and control your cursor to navigate the menu. Activate Developer Settings and enable debugging (as described above). Confirm PC authorization with your mouse. If the screen is completely black, but the phone is determined by the PC, try the adb blind commands (e.g. adb shell input tap 500 500 for tap emulation).
Do I need to disable USB debugging after use?
Yes, unless you plan to permanently connect to your PC to debug. Activated mode provides low-level access to the system, which can be used for: Install malware via ADB. Data theft (e.g. copying an SMS database or contacts). Bypass lock screen (on some firmware). Disable debugging in Developer Settings after completion. It is also recommended to revoke permissions for all PCs through Revoke USB debugging authorizations.
What are the alternatives to USB debugging for Xiaomi?
If USB-Port is faulty or debugging is blocked MIUI, Consider the following options: πŸ“Ά Debugging over Wi-Fi: In Developer Settings, enable Wi-Fi Debugging and connect via adb connect [IP-address]. πŸ”Œ Fastboot: If you need to flash your device, use Fastboot mode (power retention enabled) + Vol Down with the phone switched off). πŸ–₯️ Emulators: Use Android Studio Emulator or Genymotion to test applications. Wi-Fi debugging is less stable than it is on Wi-Fi. USB, and requires pre-activation of debugging through the cable.