The forgotten pattern lock on Xiaomi's smartphone is one of the most common problems users face. PIN-The lock pattern is not always easy to recover from memory, especially if you have not used it in a long time.The situation is complicated by the fact that after 5 failed attempts, the system can lock the device for 30 seconds or even require you to enter your Mi Account information.
In this article, weβll look at all the current ways to bypass the pattern lock on Xiaomi, Redmi and POCO smartphones, from official methods using a Mi Account to alternative solutions through ADB, Fastboot and even hardware reset. Itβs important to understand that not all methods will save your data: some lead to a complete reset, we will indicate which ones are safe and which should be used only as a last resort.
If you are looking for a way to unlock your phone without losing photos, contacts or messages, look at the sections about unlocking through Mi Cloud and using ADB. For owners of devices with an unlocked bootloader, additional options are available, which we will also describe in detail.
1 Unblocking through Mi Account (official method)
The most reliable and recommended way Xiaomi is to use a tied Mi Account, which works on most models (Redmi Note 10/11/12, POCO X3/X4/X5, Mi 11/12/13), if:
- π± Device connected to the Internet (Wi-Fi or mobile network).
- π Remember the username and password from Mi Account.
- π The phone is synchronized with the cloud.
If after 5 unsuccessful attempts to enter the key, a window appeared with a suggestion to enter account data - follow the instructions:
- Enter the email or phone number associated with the Mi Account.
- Please enter your password and confirm the entrance.
- The system will offer to reset the pattern lock or create a new one.
If the window with unlock through the account does not appear, try:
- π Reboot the device (clip the power supply) + Volume up for 10 seconds).
- πΆ Connect to another Wi-Fi network (sometimes switching the access point helps).
- π Wait 24 hours β on some firmware, the lock is reset in a day.
β οΈ Warning: If you've previously disabled sync with Mi Cloud or reset your phone to factory settings without logging out, this method won't work.
2. Reset the pattern lock via Mi Cloud (remotely)
If your Xiaomi is connected to the Internet and linked to Mi Account, you can try remote lock reset via the Mi Cloud web interface, which works even if the phone is turned off (changes will apply the next time you turn on).
Instructions:
- Go to i.mi.com and log in.
- Select the Find Device tab (Find the device).
- Click on your smartphone in the list of devices.
- Select the Unlock Device option.
- Confirm the action via SMS or email.
After that, the pattern lock will be reset, but all data on the phone will be saved (unless a full reset is used).
- π Try updating the page or using a different browser.
- π± Make sure that the phone has enabled Find Device in the settings (Settings) β Mi Account β Find Device).
- π If the device is turned off, connect it to the charger and wait for the switch on (unlocking will apply automatically).
π‘
If you have two-factor authentication enabled in Mi Account, prepare backup codes or email/SMS access for confirmation in advance.
3. Unlock through ADB (without data loss)
The method is suitable for users who have debugging mode on their smartphone USB (USB Debugging) and access to a computer. It's one of the few ways to get around a pattern lock without resetting, but it requires some pre-regulation.
If USB debugging has been activated before blocking, follow the instructions:
- Connect your phone to your PC through USB-cable.
- Open the Command Prompt (Windows) or Terminal (macOS/Linux) in the folder with ADB.
- Enter the command to check the connection: adb devices If the device appears in the list, go further.
- Delete the file with the pattern lock: adb shell rm /data/system/gesture.key or for newer versions of Android: adb shell rm /data/system/locksettings.db adb shell rm /data/system/locksettings.db-wal adb shell rm /data/system/locksettings.db-shm
- Reboot your phone: adb reboot
After the reboot, the pattern lock will be reset, but all data (photos, messages, applications) will remain in place.
- π§ Try using adb shell su (root rights required).
- π± On some firmware MIUI The path to the key file may be different. Try: adb shell rm /data/data/com.android.providers.settings/databases/settings.db
β οΈ Note: If the debugging mode is USB It's not turned on before locking, it's not going to work. Don't try to activate debugging on a locked phone, it could cause a complete reset.
βοΈ Preparation for unblocking through ADB
4. Reset via Fastboot (for unlocked bootloader)
If your Xiaomi has an unlocked bootloader, you can reset the pattern lock via Fastboot mode, which does not store data, but works even if USB debugging is disabled.
Instructions:
- Turn off the phone.
- Press Power + Volume Down to Enter Fastboot.
- Connect the device to your PC and open the Command Prompt in the Fastboot folder.
- Enter the command to reset: fastboot erase userdata or to reset completely: fastboot -w
- Reboot the phone: fastboot reboot
After that, the device will boot with factory settings. If the bootloader is locked, an FAILED error will appear (remote: 'Flashing is not allowed in Lock State'), in which case you will need to officially unlock through the Mi Unlock Tool (the process takes up to 720 hours of waiting).
| Method | Are the data stored? | You need a PC? | Difficulty |
|---|---|---|---|
| Mi Account (on the phone) | β Yes. | β No. | β |
| Mi Cloud (remote) | β Yes. | β No. | ββ |
| ADB | β Yes. | β Yes. | βββ |
| Fastboot (unlocked) | β No. | β Yes. | βββ |
| Recovery Mode | β No. | β No. | ββ |
5. Hard reset via Recovery Mode (full cleanup)
If no other method has worked, it is a complete reset via Recovery, which deletes all data on the phone, including photos, messages and apps, but is guaranteed to unlock the device.
Instructions for Xiaomi/Redmi/POCO:
- Turn off the phone.
- Press Power + Volume Up to Enter Recovery Mode.
- Select the language (use volume buttons for navigation, power for confirmation).
- Go to Wipe Data β Wipe All Data.
- Confirm the reset (usually you need to enter Yes).
- After you complete the process, select Reboot to System.
On some models (Redmi Note 8/9, POCO X3), the path may be different:
- π Instead of Wipe All Data, look for Factory Reset.
- π If you need a password to reset, try entering default_password or leave the field empty.
β οΈ Attention: On devices with MIUI 12/13/14 After reset, you may need to re-assign Mi Account. If you do not remember the account details, the phone will turn into a "brick" (it will not be possible to activate it).
What to do if you need an old Mi Account after a reset?
6. Alternative methods (for experienced users)
If standard methods donβt work, you can try advanced methods, but they require technical skills and can result in a loss of warranty or a device failure.
Unlocking through TWRP (Castom Recovery)
If you have TWRP installed on your phone, you can manually delete the lock files:
- Download to TWRP (Nutrition + Volume Up).
- Go to Advanced β File Manager.
- Delete files: /data/system/locksettings.db /data/system/locksettings.db-wal /data/system/locksettings.db-shm /data/system/gesture.key
- Reboot.
EDL Mode bypass (for qualified users)
EDL Mode (Emergency Download Mode) allows you to flash your device through special tools like the Mi Flash Tool, a method used by service centers, but requires:
- π§ Authorized Xiaomi account for downloading firmware.
- π Special cable or test point on the board.
- π» Knowledge of working with Qualcomm or Mediatek chips.
Without experience, it is not recommended to use EDL, as there is a risk of turning the phone into a brick.
π‘
If you are not sure about your skills, you should contact the Xiaomi service center. Wrong actions in EDL Mode can damage the bootloader, and the phone will not turn on.
7.How to avoid blocking in the future
To avoid the problem of a forgotten pattern lock, follow these simple tips:
- π Use it. PIN-code instead of a pattern lock, it is easier to remember.
- π Write the key in a secure location (for example, in a password manager).
- π Regularly sync your data with Mi Cloud or Google Account.
- π§ Turn it on. USB Debugging in advance (in case of future problems).
- π± Set up Smart Lock in Android to automatically unlock in secure locations (home, work).
It is also useful to back up important data:
- Go to Settings β About Phone β Backup.
- Choose Local Backup or Google Drive.
- Save a copy to a memory card or PC.