Forgot to enable USB debugging on Xiaomi before locking the screen?The situation is familiar to many: the phone requires a password, a fingerprint or a pattern lock, and without activated debugging, you can not connect through ADB to reset. Fortunately, even on a locked device there are workarounds - from using the Fastboot mode to hidden service codes of the engineering menu.
In this article, we will discuss 5 proven methods that work on most Redmi, POCO and Mi models (including Redmi Note 10/11/12, POCO X3/X4/X5, Mi 11/12). Importantly, not all methods are universal β the effectiveness depends on the version of MIUI, the type of lock (PIN, pattern lock, Mi Account) and the status of the bootloader. Prepare for the fact that it may be necessary to unlock the bootloader through Mi Unlock is the only legal way for new devices with a locked bootloader.
Why USB Debugging Doesn't Enable on a Blocked Xiaomi
The main problem is MIUI security, which by default blocks access to ADB and Fastboot when the screen is activated, and here are the key reasons why standard methods don't work:
- π Data protection MIUI: Starting with MIUI 12, Xiaomi tightened security policies.Even if you plug your phone into a PC, the system won't provide access to debugging without unlocking the screen.
- π‘οΈ Locked bootloader: On new devices (released after 2021), the bootloader is locked by default.Without unlocking it via the Mi Unlock Tool, most Fastboot commands will not be available.
- π± Hardware encryption: models with Qualcomm Snapdragon chipsets 8xx (For example, Xiaomi 12 Pro, POCO F4 GT) use FBE (File-Based Encryption, which makes data inaccessible without a password even through a TWRP.
The good news is that if the device has already unlocked the bootloader or installed customized recap (TWRP), the chances of success are much higher, otherwise you will have to combine methods or use the official Mi Unlock (but it requires linking the Mi Account to the device).
β οΈ Note: Methods using Fastboot and EDL This can result in complete loss of data or blocking of the Mi Account. If the Find Device function is enabled on the phone, after reset via Fastboot, the device may require authorization of the previous account.
Method 1: Enabling debugging through the engineering menu (for older versions of MIUI)
This method works on devices with MIUI 10β12 (pre-released 2021 It allows you to bypass the lock screen through hidden service codes. 12+ and MIUI 13/14.
Instructions:
- On the locked screen, enter the call code: ##4636## (Testing menu will open).
- If the code didn't work, try alternatives: ##284## - sensor test (can give you access to settings). ##36446337## - engineering menu for some Redmi models.
Usage statistics
Developer options
USB Debugging
βοΈ What to do if the engineering menu does not open
If the engineering menu is open but there is no debugging option, try another method. On new devices, Xiaomi has removed most of the security holes, so it works less and less.
Method 2: Unlocking via Fastboot (requires an unlocked bootloader)
If your Xiaomi already has a bootloader unlocked, you can enable USB debugging via Fastboot even if the screen is locked, a method that is suitable for devices that previously unlocked through the Mi Unlock Tool.
Step-by-step:
- Turn off your phone. Press Power + Vol- to enter the Fastboot (there will be a hare on the screen that says Fastboot).
- Connect your device to your PC via USB and check for detection: fastboot devices If the device is not identified, install the Mi Flash Tool drivers.
- Enter the command to temporarily unlock OEM: fastboot oem unlock-go Note: This command will only work if the bootloader is already unlocked!
- Reboot your phone to the system: fastboot reboot
- After downloading, quickly connect to ADB Adb shell settings put global settings development_settings_enabled 1 adb shell am start -n com.android.settings/.DevelopmentSettings
| Xiaomi model | Support for fastboot oem unlock-go | Alternative team |
|---|---|---|
| Redmi Note 9/10 | β Yes. | fastboot oem unlock (requires confirmation) |
| POCO X3 NFC | β Yes. | fastboot flashing unlock |
| Mi 11 Ultra | β No (needs Mi Unlock) | Official unlocking only |
| Redmi K40 | β οΈ Partially (depending on version) MIUI) | fastboot oem edl (transition to EDL) |
β οΈ Note: Fastboot oem unlock command on new devices (Snapdragon) 8 Gen 1/2) This can lead to a hard lock (brick) if the bootloader has not been officially unlocked through the Mi Unlock Tool.
Method 3: Use of EDL mode (for advanced users)
EDL (Emergency Download Mode) is an emergency firmware mode that allows you to bypass the locking of the screen and even reflash the device. Minus: requires a special cable (EDL cable) or short circuit test points on the board.
How it works:
- Transfer the phone to EDL: π With help. EDL-cable (closes the contacts D)+ and D- when connected to USB). π οΈ Through test points (requires disassembly of the device). π» Fastboot oem edl (not working on all models).
Qualcomm HS-USB QDLoader 9008
here
Mi Flash Tool
QFil
firmware
What are the risks of firmware through EDL?
For models with MediaTek (e.g. Redmi 10A, POCO M4), BROM mode is used instead of EDL. Here you will need the SP Flash Tool utility and an authorization file (you can get it on forums like XDA or 4PDA).
Method 4: Bypassing Mi Account (official method)
If you have a Mi Account attached to your phone, you can try unlocking your device through the Mi Account web interface, which only works if:
- π± The phone is connected to the Internet (via Wi-Fi or mobile network).
- π You remember the username/password from the Mi Account associated with the device.
- π Find Device has been activated in the settings.
Instructions:
- Go to the Find Device website and log in.
- Select the locked device from the list.
- Press "Unlock Device" (unlock device).
- Confirm the action via SMS or email.
If the phone doesnβt show up in Find Device, try:
- π Reboot your device (sometimes connecting to the network helps).
- πΆ Insert SIM-card with active internet (if the phone supports) LTE).
- β³ Wait 24-48 hours β sometimes Xiaomi servers delay synchronization.
β οΈ Warning: Once unlocked via Mi Account, you may need to reset to factory settings. If encryption is enabled on the device, the data will be lost!
Method 5: Install TWRP and reset password (for unlocked bootloader)
If your Xiaomi has unlocked a bootloader, the most reliable way is to install TWRP and manually delete the lock files, a method that requires minimal knowledge of ADB and Fastboot.
Step-by-step:
- Download TWRP for your model from the official website twrp.me or trusted forums (XDA, 4PDA).
- Transfer your phone to Fastboot (Power + Vol-).
- TWRP: fastboot flash recovery twrp.img fastboot boot twrp.img
- In TWRP, go to Advanced β File Manager.
- Delete the following files (responsible for screen locking): /data/system/gesture.key /data/system/password.key /data/system/locksettings.db /data/system/locksettings.db-wal /data/system/locksettings.db-shm
- Reset the device. Password/pattern lock will be reset!
lock
For Android 10+ and FBE (file-level encryption) devices, this method may not work β a full Format Data reset to TWRP will be required (the entire user partition will be formatted).
Frequent Mistakes and How to Avoid Them
When trying to enable USB debugging on a locked Xiaomi, users often face typical problems.
| Mistake. | Reason. | Decision |
|---|---|---|
| fastboot: unknown command 'oem unlock-go' | The bootloader is not officially unlocked | Use the Mi Unlock Tool to unlock the device |
| Phone is not defined in fastboot devices | There is no driver or faulty cable | Install the Mi Flash Tool and try another one. USB-cable (preferably original) |
| EDL mode not detected | Incorrect closure of test points | Check the circuit for your model or use it. EDL-cable |
| After the firmware, the phone asks for an old password | FBE encryption is still in place | Run Format Data in TWRP (Full Cleanup) |
If none of the methods worked, the last option is the official Xiaomi service center, which in some cases (for example, when you block a Mi Account), only they can unlock the device without losing data, the cost of the service varies from 1,500 to 5 000 rubles depending on the model.
π‘
On new Xiaomi devices (2022 and later), the only legal way to unlock without losing data is the official Mi Unlock Tool. All other methods require an unlocked bootloader or lead to a reset.