How to enable USB debugging on Xiaomi if your phone is locked: all working methods

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:

  1. On the locked screen, enter the call code: ##4636## (Testing menu will open).
  2. 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

Done: 0 / 3

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.

πŸ“Š What kind of smartphone you Xiaomi?
Redmi Note 10/11/12
POCO X3/X4/X5
Mi 11/12/13
Other (specify in the comments)

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:

  1. Turn off your phone. Press Power + Vol- to enter the Fastboot (there will be a hare on the screen that says Fastboot).
  2. 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.
  3. Enter the command to temporarily unlock OEM: fastboot oem unlock-go Note: This command will only work if the bootloader is already unlocked!
  4. Reboot your phone to the system: fastboot reboot
  5. 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 modelSupport for fastboot oem unlock-goAlternative 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:

  1. 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?
1. Loss of all data (including internal memory). 2. Possible IMEI lock (on some models, serial numbers are lost after firmware is EDL). 3. Risk of a "brick" (inoperable device) if you choose the wrong firmware. 4. On new devices (with Snapdragon 8+ Gen 1), Xiaomi blocks firmware through EDL without authorization.

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:

  1. Go to the Find Device website and log in.
  2. Select the locked device from the list.
  3. Press "Unlock Device" (unlock device).
  4. 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:

  1. Download TWRP for your model from the official website twrp.me or trusted forums (XDA, 4PDA).
  2. Transfer your phone to Fastboot (Power + Vol-).
  3. TWRP: fastboot flash recovery twrp.img fastboot boot twrp.img
  4. In TWRP, go to Advanced β†’ File Manager.
  5. 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
  6. 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 unlockedUse the Mi Unlock Tool to unlock the device
Phone is not defined in fastboot devicesThere is no driver or faulty cableInstall the Mi Flash Tool and try another one. USB-cable (preferably original)
EDL mode not detectedIncorrect closure of test pointsCheck the circuit for your model or use it. EDL-cable
After the firmware, the phone asks for an old passwordFBE encryption is still in placeRun 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.

FAQ: Answers to Frequent Questions

Can you enable USB debugging on Xiaomi without resetting data?
Theoretically yes, but only if: πŸ”“ The device has already unlocked the loader and installed TWRP. πŸ“± The phone is connected to your Mi Account and you can unlock it through Find Device. πŸ› οΈ You're using it. EDL-A mode with firmware that stores data (rarely available for new models) will lose data in all other cases when you reset your password.
Why does the phone ask for a password from an old Mi Account after a Fastboot reset?
This is due to the Mi Cloud Lock feature (anti-theft protection) even after being reset via Fastboot or TWRP The device may require authorization of the previous account if: πŸ”„ Synchronization with Mi Cloud was enabled. πŸ“± The phone is tied to a Mi Account (even if you haven't used it).Solution: Contact Xiaomi for proof of ownership (checks, box, IMEI).
What Xiaomi models can’t be unlocked without the official Mi Unlock?
S 2021 Xiaomi tightens security policy, official unlocking of bootloader is mandatory on the following devices: πŸ“± Xiaomi 12/12S/12T/13 (modifications). πŸ“± Redmi K50/K60 series. πŸ“± POCO F4/F5 newer. πŸ“± Any devices on Snapdragon 8 Gen 1/2. On these models, the commands fastboot oem unlock or fastboot flashing unlock will not work without prior authorization via the Mi Unlock Tool.
Can I bypass screen locking through ADB if debugging was enabled earlier?
Yes! If USB debugging was activated before locking, you can reset your password via ADB: Connect your phone to your PC and check the connection: adb devices Delete lock files: adb shell rm /data/system/gesture.key adb shell rm /data/system/password.key Reboot your device: adb reboot If the phone requests a password after reboot, repeat the steps and further clear: adb shell rm /data/system/locksettings.db*
Where to download official firmware for Xiaomi?
Official firmware (Fastboot and Recovery) can be downloaded from these resources: 🌍 Official website MIUI (Choose a Global Region or EEA). πŸ› οΈ Xiaomi Firmware Updater (unofficial but reliable source). πŸ’¬ 4PDA (Russian-speaking community with firmware and instructions). ⚠️ Warning: Unofficial firmware may contain viruses or be unstable. MD5-hash.