Debugging USB on Xiaomi MIUI 11: how to turn on and configure without errors

USB debugging mode on Xiaomi smartphones with MIUI 11 shell is a hidden feature for developers that gives access to advanced features of the device. Without its activation, you can not install custom firmware, unlock the bootloader, test applications through ADB or restore data after crashes. However, to enable this mode is not so easy: the manufacturer hides the option in the depth of the menu, and the procedure requires preliminary preparation.

In this article you will find the correct instructions for MIUI 11 (2019-2020) which runs on the Redmi Note 8 Pro, Mi models 9T, Mi A3 We're going to look at not only the standard way to turn on, but also how to get around possible locks, and why, after upgrading to the new one, we're going to look at how to do this. MIUI 12+ The algorithm may change. If you've encountered a bug before, "Debugging by the computer." USB Unavailable or the system required Mi Account – there are solutions.

What is USB debugging and why you need it on Xiaomi

Debugging by USB (USB Debugging is a mode that allows a device to interact with a computer via a protocol. ADB (Android Debug Bridge. It's used for:

  • πŸ”§ Install custom firmware (such as LineageOS or Pixel Experience) via fastboot.
  • πŸ“± Unlocking the bootloader (Bootloader) - a mandatory step before the firmware.
  • 🐞 Testing applications in Android Studio or through ADB-team.
  • πŸ”„ Data recovery after a system failure (if the screen does not respond, but USB-port).
  • πŸ”“ Bypassing locks (for example, if the pattern lock is forgotten).

On MIUI 11, this mode is hidden by default, because activating it reduces the security of the device. For example, through ADB, an attacker can access files or install malware if the smartphone is connected to someone else's PC, so you should only enable debugging when necessary and turn it off after use.

⚠️ Note: Some Xiaomi models (e.g. Mi 9) SE or Redmi Note 7) after debugging, the system may require a link to the Mi Account. If you forget the password, restore it before the procedure, otherwise you risk blocking the device.

Preparation of the smartphone before debugging

Before you activate the mode, follow a few mandatory steps:

Turn on your smartphone and unlock the screen

Connect the device to charge (battery level should be >30%)

Make sure that the phone has the official firmware MIUI 11 (check in Settings β†’ About the phone)

Download and install Mi USB Driver drivers on your PC (link to the official Xiaomi website)

Disable all VPNs and proxy servers (they can block access to activation servers)

-->

Pay special attention to the MIUI versions. If your device has upgraded to MIUI 12 or later, the debugging algorithm may differ - these versions add additional protection.

  1. Open the Settings. β†’ The phone.
  2. Find the line MIUI version - it should be 11.x.x.
  3. If the version is different, use the instructions for the appropriate shell.

It is also recommended to disable the screen lock (PIN, pattern lock) at the time of setting, this will prevent automatic debugging during the reboot, after all manipulations are completed, the protection can be returned.

Redmi Note 8/8 Pro

Mi 9/9T/9 SE

Mi A3

Redmi 7/7A

Other model (specify in the comments)-->

Step-by-step: how to enable debugging by USB on MIUI 11

Follow the algorithm in strict order, and if you skip one step, the system can block access to the settings.

Step 1: Activate the Developer Mode

The default option is hidden for developers, so you can unlock it.

  1. Go to Settings. β†’ The phone.
  2. Find the MIUI version string and tap it 7 times in a row.
  3. After 3-4 clicks, a notification will appear: β€œYou are almost at the target!”
  4. After pressing 7, the system will display a message: β€œYou became a developer!”

If nothing happens after multiple clicks, check:

  • πŸ”Ή Is there a lock on the screen (for example, child mode or corporate policy).
  • πŸ”Ή Is the beta version installed? MIUI (Sometimes they turn off this function).
  • πŸ”Ή Is the smartphone connected to the Internet (required to check the status of the Mi Account).

Step 2: Enable debugging over USB

Now that the developer mode is activated:

  1. Return to the main settings menu.
  2. Select the item Additionally β†’ For developers (on some models, just for developers).
  3. Scroll down to the Debugging section.
  4. Activate the debugging switch over USB.
  5. In the confirmation window that appears, click OK.

If the system requests Mi Account after activation, enter your account information. Without linking to the account, debugging will not work - this is a measure of protection against unauthorized access.

πŸ’‘

If the USB Debugging Switch is inactive (in gray), try disabling MIUI Data Protection from the same developer menu, and then the option becomes available.

Step 3: Confirm PC Connection

When you first connect to a computer on the screen of the smartphone will appear a request:

Permit debugging over USB? Keyprint: RSA:1234:5678:90AB:CDEF [ ] Always allow from this computer

Check Always Allow and click Allow, which will eliminate the need to confirm the connection every time.

⚠️ Warning: Never confirm debugging on other people's computers! This gives you full access to your device's data. If you connect to a public PC (such as an Internet cafe), after you've finished, revoke permissions in the Developer Menu. β†’ Revoke debugging permits USB.

Common mistakes and their solutions

Even with the correct following of the instructions, users often face problems.

Mistake.Reason.Decision
USB debugging is not available (grey switch)MIUI Data Protection Activated or Mi Account Not ConfirmedTurn off data protection in the developer menu or link an account
The computer does not see the device in ADBMi USB Driver is not available or Charging is enabledInstall drivers from the official site and select File Transfer mode when connected
Do you have a request to allow debugging? every time you connectNot set to tick Always allow or reset settingsConnect again and check the box. If it doesn't work, delete the.android folder in your PC user profile.
ADB: device unauthorizedOn the smartphone is not confirmed connection or reset RSA keysRevoke permissions in the developer menu and connect again

If the ADB still doesn’t recognize the device after all the manipulations, try:

  • πŸ”Œ Change. USB-Cable (use original or certified cable) USB Type-C).
  • πŸ–₯️ Reboot your PC and smartphone – sometimes resetting the connection helps.
  • πŸ”„ Update ADB and fastboot to the latest version via SDK Platform Tools.
What if MIUI requires unlocking the bootloader?
If the system gives an error when you turn on debugging, "To continue unlock the bootloader", this means that your device has activated anti-Rollback protection. In this case: 1. Go to en.miui.com/unlock and download the Mi Unlock Tool utility. 2. Sign up for the unlock program (requires binding to Mi Account). 3. Connect your smartphone in fastboot mode (press Power + Vol Down) and follow the instructions of the utility. Note: unlocking the bootloader resets all data on the device!

Security: How to protect data when debugging is enabled

Activating debugging over USB opens up potential vulnerabilities to minimize the risks:

  • πŸ”’ Turn off debugging after completion of work (in the Developer Menu).
  • πŸ“΅ Do not connect your smartphone to a public one. USB-Ports (airports, cafes) – they can be used to steal data.
  • πŸ”‘ Use a strong password for Mi Account and enable two-factor authentication.
  • πŸ›‘οΈ Install antivirus on the PC from which you connect to the device.

If you are transferring a smartphone for repair or selling it, be sure to revoke all debugging permits:

  1. Go to Settings. β†’ For developers.
  2. Find the option to withdraw permissions to debug USB and click on it.
  3. Confirm the action.

It'll remove all the saved ones. RSA-keys and block access to the device through ADB confirm.

πŸ’‘

Included debugging by USB This allows you to bypass the screen lock through ADB-If you forgot the pattern lock, but debugging was activated earlier, you can delete the gesture.key file without losing data!

USB debugging on MIUI 11 vs MIUI 12/13: key differences

If you upgraded to a firmware after 2020, the debugging algorithm might have changed. In MIUI 12 and later, Xiaomi tightened its security policy:

  • βœ… MIUI 11 (2019-2020): Debugging is enabled without additional confirmation (except Mi Account). No PC binding (you can connect to any device after confirmation). ADB Not reset after resetting.
  • ❌ MIUI 12/13 (2021–2023): Confirmation is required through SMS or email when you first activate debugging. ADB drop off 7 days without use, added checks for OEM Unlocking (even for debugging).

If you upgraded to a new version and the debugging stopped working, try:

  1. Reverse to MIUI 11 via fastboot (if the bootloader is unlocked).
  2. Use alternative methods (e.g. Wireless ADB over Wi-Fi).
  3. Contact Mi Community for current instructions for your model.

Useful. ADB-Teams for Xiaomi after enabling debugging

When USB debugging is activated, you can use ADB to extend your device management. Here are some useful commands:

adb devices

It shows you a list of connected devices. If your smartphone isn't showing up, check the drivers or the cable.

adb shell pm list packages

It displays a list of all installed applications (useful for malware search).

adb shell screencap -p /sdcard/screen.png

Takes a screenshot of the screen and saves it to the memory card.

adb backup -apk -shared -all -f backup.ab

Creates a backup of all applications and data (without root rights).

adb shell settings put global hidden_api_policy 1

Unlocks hidden APIs (required for some system modifications).

⚠️ Note: Adb shell su or fastboot oem unlock commands require an unlocked bootloader and can result in a loss of warranty or a β€œbrick” of the device. Use them only if you understand the consequences!

FAQ: Frequent debugging questions USB Xiaomi MIUI 11

Can I enable debugging over USB without being tied to Mi Account?
On MIUI 11, some models (e.g. Redmi Note 8 Pro on global firmware) allow debugging without an account. However, on the Chinese version (China ROM) or after updates, the system almost always requires authorization. If you do not have a Mi Account, create it in advance at account.xiaomi.com.
Why does the debugging stop after the reboot?
It's a feature. MIUI 11 on some models (e.g., Mi) 9 SE). To fix: Turn on debugging again. Connect to your PC and execute the command: adb shell settings put global. adb_wifi_enabled 1 Restart the device. If the problem persists, check if the option to revoke debugging permissions is activated. USB developer-menu.
How to turn on debugging if the screen is not working?
If the sensor is not responding, but the device is turning on, try: Connect your smartphone to your PC via USB. If the debugging has been enabled before, use it. ADB to control: adb shell input tap x y (where x and y are the screen press coordinates). /data/system/gesture.key (If the debugging has not been activated, you will have to take the device to a service center to repair the screen or firmware through the screen. EDL-regime.
Can I turn on the debugging through recovery?
No, standard recovery from Xiaomi does not provide access to debugging settings. However, if you have custom TWRP installed, you can: boot to TWRP (press Power + Vol Up). Connect the device to your PC. Use ADB in sideload: adb sideload file.zip But for this, the bootloader must be unlocked, and TWRP is compatible with your model.
How to disable debugging over USB remotely?
If you forgot to debug and the device is stolen or lost, you can't do it remotely. However, you can: Log in to your Mi Account on another device. Use Find Device to lock or reset data. Change the password from Mi Account so that the attacker can't confirm the debugging. In the future, avoid leaving debugging on unnecessarily.