Forgot the pattern lock on Xiaomi: 7 ways to unlock your phone (2026)

The forgotten pattern lock on Xiaomi is a situation that one in five users face. According to service center statistics, 18% of device locks are due to loss of password or unlock pattern. Especially relevant is the problem for owners of Redmi Note 12, POCO X5 and Xiaomi 13T models, where the automatic lock function is enabled by default after 5 failed attempts.

In this article, we will discuss all the current ways of unlocking (including official and engineering methods), assess the risks of data loss, and give a checklist to prepare for the procedure. Importantly, on devices with MIUI 14+ and later, some methods (for example, through ADB) can be blocked by the manufacturer due to tightening security policies, so we start with the safest options.

1 Unlocking through Mi Account (official method)

If your Xiaomi is tied to a Mi Account, it’s the fastest and safest way to get back access, and it works on 95% of devices (except for models for the Chinese market without global firmware).

Conditions:

  • πŸ“± The phone is connected to the Internet (Wi-Fi or mobile data)
  • πŸ”„ The device is synchronized with Mi Account
  • πŸ” You remember the login/password from the account (or associated) email/phone)

Step-by-step:

  1. On the lock screen, click Forgot the pattern lock? (or Forgot pattern? on English firmware).
  2. Select Sign in via Mi Account.
  3. Enter your email/phone and password from your account.
  4. Confirm your login via SMS or email (if two-factor authentication is enabled).
  5. Create a new pattern lock or PIN-code.

⚠️ Note: If you have previously disabled sync with Mi Account in settings (Settings) β†’ Accounts. β†’ Mi Account β†’ Synchronization, this way won't work, and it's also on some models (e.g. Redmi). 10C) After 10 failed attempts to enter the key, the system can block unlocking through the account for 24 hours.

πŸ“Š How often do you use your Mi Account to back up?
Always.
Sometimes.
Never.
I don't know what it is.

2. Reset the pattern lock via Fastboot (without data loss)

The method is suitable for devices with an unlocked bootloader. If you previously activated OEM Unlock in the developer settings, the chances of success are 80%. On new models (Xiaomi 14, POCO F5), the bootloader is blocked by default, and unlocking requires waiting 7-15 days after the account is attached.

What you need:

  • πŸ’» Computer with Windows/Linux/macOS
  • πŸ”Œ USB-cable (original or high quality)
  • πŸ› οΈ Utilities. ADB Fastboot (download from the official Android website)
  • πŸ“„ File. recovery_clr_key.img For your model (can be found on the forums) 4PDA or XDA Developers)

Instructions:

  1. Turn off the phone. Press Volume down + Power to enter Fastboot Mode.
  2. Connect the device to your PC and open the command line in the folder with ADB.
  3. Check the connection command: fastboot devices must display the serial number of the device.
  4. Recovery: Fastboot Flash Recovery recovery_clr_key.img fastboot boot recovery_clr_key.img
  5. From the recovery menu, select Wipe β†’ Format Data (this will only remove the pattern lock, not all data!).
  6. Reboot the phone:

⚠️ Note: On devices with encrypted storage (by default in the MIUI 12+) Formatting a data partition can cause you to lose access to files. Before the procedure, check if encryption is included in Settings β†’ Additionally. β†’ Encryption and credentials.

β˜‘οΈ Preparing for Unlocking via Fastboot

Done: 0 / 5

3.Use of Recovery Mode (with loss of data)

If previous methods failed, it is hard to reset through Recovery Mode, which erases all data on the device, including photos, messages and apps, but it works on 100% of Xiaomi devices, regardless of bootload status.

How to log in to Recovery:

  • Turn off the phone.
  • Press Volume Up + Power for 10-15 seconds.
  • Release the buttons when the Mi logo appears.

Resetting instructions:

  1. In the recovery menu, select the language (usually English or Chinese).
  2. Go to Wipe Data β†’ Wipe All Data.
  3. Confirm the action with swipe or select Yes.
  4. After reset, select Reboot β†’ Reboot to System.

πŸ’‘ Useful tip: If after resetting the phone requires you to enter the data of the previous Google account (FRP-locking, use the instructions for bypassing FRP end-of-article.

Unlocking methodData retentionPC requiredDifficultyIt works at MIUI 14+.
Mi Accountβœ… Yes.❌ No.β­βœ… Yes.
Fastboot (recovery_clr_key)βœ… Yes*βœ… Yes.⭐⭐⭐⚠️ Partially.
Recovery (Wipe Data)❌ No.❌ No.β­β­βœ… Yes.
ADB (obsolete)βœ… Yes.βœ… Yes.⭐⭐⭐⭐❌ No.

* - no data loss unless the storage is encrypted.

4.Unlock via ADB (only for older versions of MIUI)

Before MIUI 12 (2020), it was possible to delete the pattern lock via ADB by connecting to the phone in debugging mode, and this method now only works on devices with firmware older than MIUI 11 or custom builds (for example, LineageOS).

Conditions:

  • πŸ”§ The phone's on debugging. USB (Settings β†’ The phone. β†’ Version. MIUI β€” Press 7 times, then additionally β†’ For developers β†’ Debugging by USB)
  • πŸ–₯️ Installed drivers Xiaomi on PC
  • πŸ“Ά The phone is connected to the PC and recognized by the system

Commands for key reset:

adb shell


su




rm /data/system/gesture.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

⚠️ Attention: On new versions MIUI These files can be stored in an encrypted partition. /data, And if you delete them, you'll lose all your data. MIUI In Settings β†’ The phone.

Why isn’t ADB working on Xiaomi?
With MIUI 12, Xiaomi tightened its security policy by blocking access to system files through ADB without root rights. Even if debugging is enabled, gesture.key removal commands will not work due to SELinux restrictions.

5. bypassing FRP-blocking after reset (if required by an old Google account)

After a hard reset via Recovery, Android 5.1+ devices can request data from a previous Google account (Factory Reset Protection), which is anti-theft protection, but it also prevents legal owners. There are several ways Xiaomi can bypass:

Method 1: Mi Account (if the phone is tied)

  • On the Google account entry screen, click Add Account.
  • Enter the data from the Mi Account tied to the phone.
  • The system will prompt you to create a new PIN or pattern lock.

Method 2: Use the Mi FRP Tool

  • Download the utility with XDA Developers (e.g. Mi FRP Bypass Tool v3.2).
  • Connect your phone to your PC in Fastboot mode.
  • Run the utility and select the model of your device.
  • Follow the instructions on the screen (usually you need to flash a temporary recovery and delete the file). frp_lock).

⚠️ Attention: Use of informal circumvention tools FRP It may lead to a blockage. IMEI device-wise MIUI 13+. Before using, check reviews about a specific utility on thematic forums.

6. Contact the Xiaomi Service Center

If all the independent methods fail, you have to go to an authorized service center, which is the most reliable, but also the longest way, and according to Xiaomi Russia, the average unlock time is 3-5 working days.

What will be required:

  • πŸ“„ Passport or other identity document
  • πŸ“± Check or warranty card (if the phone is guaranteed)
  • πŸ’³ Payment for the service (from 1,500 to 3,000 rubles depending on the model)

How to find the official service:

  1. Go to the Xiaomi support website.
  2. Enter the name of your model in the search box.
  3. Select the nearest service center on the map.
  4. Check by phone whether they are engaged in unlocking pattern lock (not all centers provide this service).

πŸ’‘ Useful tip: Before visiting the service, take a screenshot of the lock screen with the serial number of the device (it is displayed in Fastboot Mode.

πŸ’‘

Official service is the only legal way to unlock if the phone is tied to a corporate account or has active financial protection (for example, through Xiaomi Finance).

7.Prevention: How to avoid blocking in the future

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

Security settings:

  • πŸ” Use it. PIN-code instead of a pattern lock (it is easier to remember).
  • πŸ“± Attach a fingerprint or facial recognition as an alternative way to unlock.
  • πŸ”„ Enable automatic password backup in Mi Account (Settings) β†’ Accounts. β†’ Mi Account β†’ Backup).

Actions in case of blocking:

  • πŸ“ Write down a pattern lock or PIN in an encrypted note (for example, in Google Keep with password only access).
  • πŸ”— Link your phone to two accounts (Mi Account) + Google to increase the chances of unblocking.
  • πŸ”‹ Check your status regularly OEM Unlock in the developer settings (in case of future manipulations via Fastboot).

⚠️ Note: Do not use third-party password management apps (such as App Lock) unless they are from Xiaomi.They often conflict with system locking and can result in complete loss of access without the ability to restore.

πŸ’‘

Create a text file on the PC desktop with the name "Xiaomi_Unlock.txt" And you can save the serial number (you can find it in Fastboot Mode or on the box) and it will help you quickly find the device in the service center.

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging is not enabled?
No. Without debugging enabled or unlocked bootloader, the only way to do this without losing data is to unlock through Mi Account, and if the account is not tied or synced, you'll have to use Fastboot or Recovery, which will result in a reset.
What if the phone asks for an old PIN instead of a pattern lock after reset?
This means that an alternative device has been installed on the device. PIN Try to enter the last one you use. PIN-If you don't remember, you'll need to reset it through Recovery or call the service.
Does the SP Flash Tool work on the new Xiaomi?
No. SP Flash Tool is designed for MediaTek processor devices (e.g. Redmi 9A or POCO C31) This method is not applicable on new Qualcomm Snapdragon models (e.g. Xiaomi 13 or POCO F4).
How do I know if my bootloader is unlocked on my Xiaomi?
Turn off your phone and log in to Fastboot Mode (clamb Volume Down + Power). If the bottom of the screen says Unlocked, the bootloader is unlocked. If Locked is locked, new devices may display Relocked (re-locked after unlocking).
Can I recover data after resetting through Recovery?
Theoretically, yes, but only if: The phone has decrypted (Settings β†’ Additional β†’ Encryption and credentials). You backed up through Mi Cloud or Google Drive. You use professional tools like Dr.Fone or Tenorshare 4uKey (recovery success is ~30%). In practice, on devices with MIUI 12+ and encryption enabled, data cannot be restored.