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:
- On the lock screen, click Forgot the pattern lock? (or Forgot pattern? on English firmware).
- Select Sign in via Mi Account.
- Enter your email/phone and password from your account.
- Confirm your login via SMS or email (if two-factor authentication is enabled).
- 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.
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:
- Turn off the phone. Press Volume down + Power to enter Fastboot Mode.
- Connect the device to your PC and open the command line in the folder with ADB.
- Check the connection command: fastboot devices must display the serial number of the device.
- Recovery: Fastboot Flash Recovery recovery_clr_key.img fastboot boot recovery_clr_key.img
- From the recovery menu, select Wipe β Format Data (this will only remove the pattern lock, not all data!).
- 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
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:
- In the recovery menu, select the language (usually English or Chinese).
- Go to Wipe Data β Wipe All Data.
- Confirm the action with swipe or select Yes.
- 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 method | Data retention | PC required | Difficulty | It 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?
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:
- Go to the Xiaomi support website.
- Enter the name of your model in the search box.
- Select the nearest service center on the map.
- 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.