How to remove the pattern lock on Xiaomi, if you forgot the password: the complete guide

The forgotten pattern lock on Xiaomi is one of the most common problems faced by users of the brand. According to service centers, about 15% of calls are related to unlocking the screen after unsuccessful attempts to enter a pattern, the situation is complicated by the fact that the manufacturer is actively implementing data protection features, and simply restarting the device does not help to bypass the lock, as it was on older versions of MIUI.

In this article, we will look at all the current ways to remove a pattern lock, from official methods using a Mi Account to technical solutions through Fastboot and Recovery modes. It is important to understand that the choice of method depends on the phone model, the firmware version and whether synchronization functions were previously enabled. For example, on devices with a Qualcomm Snapdragon chip (for example, Redmi Note 10 Pro or POCO X3 Pro), additional tools like EDL Mode are available, while on budget models with MediaTek processors (for example, Redmi 9A) options are limited.

Before you proceed to unlock, check if one of these scenarios is appropriate:

  • πŸ”„ You remember the data from the Mi Account linked to the phone
  • πŸ“± The device is debugging on USB (ADB)
  • πŸ”§ There is access to a computer with installed Xiaomi drivers
  • πŸ“¦ You are ready for a complete data reset (if other methods don’t work)
πŸ“Š What Unlocking Method Have You Tried Before?
Mi Account
Reset via Recovery
Fastboot
ADB
I've tried nothing.

1 Unlocking through Mi Account (official method)

The most secure and recommended method Xiaomi uses is the use of a tied account Mi Account. It works on all devices with MIUI 10 and newer, but requires a stable Internet connection. If the phone is connected to a mobile network or Wi-Fi, after 5 failed attempts to enter the pattern lock, the button Forgot the password will appear.

Algorithm of action:

  1. On the lock screen, tap Forgot the password? (or Forgot pattern on English firmware).
  2. Enter the email or phone number associated with the Mi Account.
  3. Confirm the entrance through SMS-account code.
  4. Follow the system instructions to create a new pattern lock.

⚠️ Note: If two-factor authentication is enabled on the device (2FA), You will need to confirm via a backup email or Mi Security app on some models (e.g. Xiaomi). 12T) After unlocking, you may need to re-link the account.

Make sure your phone is connected to the Internet |Remember the email/number linked to Mi Account |You have access to a backup email for 2FA| Battery charge is enough for 10-15 minutes of operation

-->

2. Reset the pattern lock via ADB (for power users)

The Android Debug Bridge (ADB) method is suitable if the phone previously had USB Debugging enabled (Settings β†’ About Phone β†’ MIUI Version β†’ 7 times tap to unlock the developer mode).

Tools required:

  • πŸ–₯️ Computer with Windows/macOS/Linux
  • πŸ”Œ USB-cable (preferably original)
  • πŸ“¦ Installed drivers Xiaomi and ADB Tools

Instructions:

  1. Connect the phone to your computer and open the command line (Win + R β†’ enter cmd).
  2. Check the connection of the device command: adb devices The list should display your device.
  3. Delete the file with the pattern lock: adb shell rm /data/system/gesture.key
  4. Reboot your phone: adb reboot

Once you restart, the lock screen will disappear. PIN-code (on some firmware), use backup PIN, which you specified when setting up the pattern lock.

What if the ADB can’t see the device?
If the adb device command returns an empty list: 1. Make sure that the debugging is done by USB included (Settings) β†’ Additionally. β†’ For developers. 2. Reinstall Xiaomi drivers via Mi PC Suite. 3. Try another one. USB-cable or port. 4 on some models (POCO F3, Redmi K40) You need to confirm the power of attorney of the computer on the phone screen.

3 Unlocking via Fastboot (without data loss)

Fastboot mode allows you to bypass the pattern lock on devices with an unlocked bootloader (bootloader), which works on most Xiaomi models, but requires preliminary preparation. On devices with a locked bootloader (by default on all new phones), this method will not work without official unlocking through the Mi Unlock Tool.

Step-by-step:

  1. Turn off your phone. Press down Power + Volume to enter Fastboot.
  2. Connect the device to your computer and check detection: fastboot devices
  3. Download the firmware archive for your model from the Xiaomi Firmware Updater website.
  4. Remove the file persist.img from the archive and flash it: fastboot flash persist persist.img
  5. Reboot the phone: fastboot reboot

⚠️ Note: On some models (Xiaomi Mi) 11, Redmi Note 11 Pro+) After this procedure, you may need to re-activate the device through Mi Account. If the bootloader is blocked, try to flash persist.img lead to error FAILED (remote: 'Flashing is not allowed').

Xiaomi modelSupport for FastbootRequires unlocking of the loader
Redmi Note 10/10 ProYes.Not (if the bootloader is already unlocked)
POCO X3/X3 ProYes.Yes (default blocked)
Xiaomi 12/12 ProPartially (only persist)Yes.
Redmi 9/9A/9CYes.No (on old firmware)

4. Reset settings via Recovery Mode (complete data cleanup)

If previous methods didn't work, there's a radical way to do it: hard reset through recovery mode, which will remove all data from the device, including photos, contacts and apps, and only use it as a last resort!

How to reset Xiaomi through Recovery:

  1. Turn off the phone. Press Power + Volume up until the Mi logo appears.
  2. In the Recovery menu, select the language (volume buttons) and confirm the choice with the power button.
  3. Go to Wipe Data β†’ Wipe All Data.
  4. Confirm the reset by selecting Confirm.
  5. After you complete the process, select Reboot to System.

⚠️ Attention: On devices with MIUI 13 and later, after the reset, you may need to enter data from the previously associated Mi Account (Factory Reset Protection function). If you do not remember the username / password, the phone will turn into a "brick", in which case you will need official proof of ownership through the service center.

πŸ’‘

Before resetting via Recovery, try connecting your phone to your computer in MTP mode (if it is detected).You may be able to copy important files through Windows Explorer without even unlocking the screen.

5. Alternative methods for specific models

Some Xiaomi devices have unique unlocking features, such as:

  • πŸ“± Redmi Note 8/8 Pro: On these models, you can bypass the pattern lock through EDL Mode (Emergency Download Mode) with the Mi Flash Tool. You will need an authorized Xiaomi developer account and a Deep Flash cable.
  • πŸ“± POCO F1: The device supports unlocking through Test Point - physical closure of contacts on the motherboard for entering the computer. EDL.

For models with a MediaTek processor (for example, Redmi 9T, POCO M3) there is a SP Flash Tool, but its use requires firmware skills and can lead to a brick (breakdown) of the device if errors occur.

πŸ’‘

On MediaTek devices, never use firmware designed for Qualcomm models, and vice versa. This is guaranteed to bring the phone down!

6.How to avoid blocking in the future

To avoid the problem of a forgotten pattern lock again, follow these tips:

  • πŸ” Use it. PIN-A code or password instead of a pattern lock is easier to restore through Mi Account.
  • πŸ“§ Link your Google and Mi Account to your phone, even if you don’t plan to use Xiaomi.
  • πŸ”„ Regularly back up through Settings β†’ System and device β†’ Backup.
  • πŸ–₯️ Turn on Debugging. USB and keep a backup copy of the data through ADB backup.

On devices with MIUI 14, the Emergency Access feature (Settings β†’ Password & Security β†’ Emergency Access) is introduced, which allows you to add a trusted phone number to unlock. If you forget the pattern lock, the system will send a one-time code to the specified number.

You should also pay attention to the Smart Lock settings in Android, which allows you to automatically unlock your phone in trusted places (such as at home or work) or when connecting to trusted devices (such as the Mi Band smartwatch). β†’ Password and security β†’ Smart Lock.

Frequently asked questions

Can you unlock Xiaomi without losing data if USB debugging is not enabled?
Unfortunately, without USB debugging enabled and without the Mi Account tied, it is almost impossible to unlock the phone without a data reset. The only chance is to exploit vulnerabilities in specific versions of the firmware (for example, the DirtyCOW exploit for older versions of Android), but this requires deep technical knowledge and does not guarantee success.
What if your phone needs an old Mi Account after resetting via Recovery?
This is triggered by Factory Reset Protection (FRP) function. You will need: Enter data from the previously linked Mi Account. If you do not remember the data, contact the account recovery service with proof of purchase (check, box with IMEI). In extreme cases, visit the authorized service center Xiaomi with documents on the phone. Self-bypass FRP on new firmware (MIUI 13+) is almost impossible without official confirmation.
Will the ADB method work for Xiaomi on a MediaTek processor?
Yes, the ADB method is universal and works independently of the processor (Qualcomm, MediaTek, Exynos), the main condition is the USB debugging enabled. However, some models with MediaTek (for example, Redmi 10A) may require additional authorization through the Mi Unlock Tool even for ADB commands.
How to unlock the pattern lock on Xiaomi if the phone is dead?
First, charge the device to at least 20-30%. To do this: Connect the phone to charge and wait 10-15 minutes. If the screen does not turn on, press Power + Volume up for 10-15 seconds for a forced reboot. If the phone does not respond, use an external charger (for example, power bank) or connect to the computer. Some models (POCO M4 Pro, Redmi Note 11) have a fast charge function when turned off - the phone will show a charge indicator even without turning on.
Can I bypass the pattern lock through service codes (##...)?
No, service codes (e.g. #4636##) do not allow you to bypass the lock screen, which are designed to diagnose the network, test hardware and hidden settings, but do not have access to unlock functions, and in addition, on new versions of MIUI, most engineering codes are blocked for ordinary users.