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.
- Open the Settings. β The phone.
- Find the line MIUI version - it should be 11.x.x.
- 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.
- Go to Settings. β The phone.
- Find the MIUI version string and tap it 7 times in a row.
- After 3-4 clicks, a notification will appear: βYou are almost at the target!β
- 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:
- Return to the main settings menu.
- Select the item Additionally β For developers (on some models, just for developers).
- Scroll down to the Debugging section.
- Activate the debugging switch over USB.
- 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 Confirmed | Turn off data protection in the developer menu or link an account |
| The computer does not see the device in ADB | Mi USB Driver is not available or Charging is enabled | Install drivers from the official site and select File Transfer mode when connected |
| Do you have a request to allow debugging? every time you connect | Not set to tick Always allow or reset settings | Connect again and check the box. If it doesn't work, delete the.android folder in your PC user profile. |
| ADB: device unauthorized | On the smartphone is not confirmed connection or reset RSA keys | Revoke 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?
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:
- Go to Settings. β For developers.
- Find the option to withdraw permissions to debug USB and click on it.
- 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:
- Reverse to MIUI 11 via fastboot (if the bootloader is unlocked).
- Use alternative methods (e.g. Wireless ADB over Wi-Fi).
- 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 devicesIt shows you a list of connected devices. If your smartphone isn't showing up, check the drivers or the cable.
adb shell pm list packagesIt displays a list of all installed applications (useful for malware search).
adb shell screencap -p /sdcard/screen.pngTakes a screenshot of the screen and saves it to the memory card.
adb backup -apk -shared -all -f backup.abCreates a backup of all applications and data (without root rights).
adb shell settings put global hidden_api_policy 1Unlocks 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!