How to unlock Xiaomi if you forgot your graphical password: working ways without losing data

The forgotten pattern lock on Xiaomi is a situation that one in five users face. The main problem is that most standard solutions (like resetting via Recovery) erase all data β€” photos, contacts, messages. But there are methods of unlocking that allow you to save information. In this article, we will discuss 5 proven methods that are relevant to the models of Redmi Note 12/13, Poco X5/X6, Mi 11/12/13 and other devices on MIUI 14/15.

Importantly, the effectiveness of the method depends on the firmware version, whether you have a linked Mi Account and the bootloader unlock status. For example, on devices with a locked bootloader (by default on new phones), some of the ways will not work, and we will note these nuances in each section.

If you have tried to enter a pattern lock repeatedly and you see a notification "Try again in 30 minutes", do not panic - this is standard MIUI protection. It is reset after rebooting or connecting to the Internet (if time synchronization is enabled).

πŸ“Š What kind of smartphone you Xiaomi?
Redmi (Note, K-series)
Poco (F, X, M-series)
Mi (flagship series)
Black Shark (game)
Other

1 Unblocking through Mi Account (official method)

The most reliable method is if the phone is tied to a Mi Account and connected to the Internet, and works on all models, including the Redmi 10C, Poco M5, Mi 11 Lite, but requires:

  • πŸ“± Access to another device (PC, phone) to enter the personal account Mi
  • πŸ”„ Stable Internet connection on a locked smartphone (Wi-Fi or mobile network)
  • πŸ” Memorized login/password from the account (or associated) email/phone-restore)

Instructions:

  1. On the lock screen, tap β€œForgot Password?” (or β€œForgot Pattern?” on English firmware).
  2. Select Sign in with Mi Account (Sign in with Mi Account).
  3. Enter your email/phone and account password. If you don't remember your password, restore it through Xiaomi's website.
  4. After successful authorization, the system will prompt you to create a new pattern lock or PIN-code.

Limitations:

  • ❌ It does not work if the phone is not connected to the network (Wi-Fi and mobile Internet are disabled).
  • ❌ On some firmware (for example, MIUI Global for Europe) β€œForgot your password?” option may not be available.
  • ❌ If the Mi Account was not linked before the lock, the method is useless.

πŸ’‘

Before unlocking, check if the phone has enabled the Find Device option (Settings β†’ Mi Account β†’ Find the device). If so, you can remotely unlock the phone via i.mi.com (Device Management section).

2.Using Fastboot and ADB mode (for advanced users)

This method is suitable if:

  • πŸ”§ The phone has a bootloader unlocked).
  • πŸ’» Access to a computer with installed ADB and Fastboot.
  • πŸ“± Debugging is on. USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 times to tap β†’ Additionally. β†’ For developers β†’ Debugging by USB).

If USB debugging wasn't on before locking, it won't work, but if it's on, follow the instructions:

β˜‘οΈ Preparation for unblocking through ADB

Done: 0 / 4

Steps:

  1. Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
  2. Connect the device to the PC via USB.
  3. Open the command line (Win + R β†’ enter cmd) and execute the commands:
fastboot devices


fastboot oem unlock




fastboot reboot

If the bootloader is unlocked, after the restart, the pattern lock will reset.

Warning: On newer models (Redmi Note 12 Pro+, Poco F5), unlocking the bootloader via fastboot oem unlock can result in a complete data reset, even if it was previously unlocked.

What if the fastboot can’t see the device?
If the fastboot device command doesn’t show your phone, install the Mi USB Driver drivers from the official website. Windows 11 may need to disable driver signature verification (test mode).

3. Delete gesture.key file via TWRP (Save data)

This is one of the few ways that data is guaranteed to be saved, but requires:

  • πŸ›  Established custom recaveri TWRP.
  • πŸ”“ Unlocked loader.
  • πŸ“ Knowledge of the structure of the Android file system.

Instructions:

  1. Turn off your phone and log in to TWRP (press the Power button + Volume up).
  2. Go to Advanced β†’ File Manager.
  3. Open the folder. /data/system/ and find the files: gesture.key (for pattern lock) password.key (for pattern lock) PIN-locksettings.db (locking database)

.bak

Reboot the phone. Once you download, the pattern lock will be reset.

Importantly, if TWRP asks for a password to decrypt /data, this method will not work, in which case the data is encrypted, and it is impossible to save it without factory reset.

πŸ’‘

Deleting gesture.key and locksettings.db will only work if the /data partition is not encrypted. On new MIUI 14+ firmware, encryption is enabled by default when you configure the pattern lock.

4. Unlock through Xiaomi Service Center (official request)

If the independent methods did not help, you can contact an authorized service center Xiaomi.

  • πŸ“„ You have documents on the phone (check, warranty card, box with a phone number) IMEI).

Procedure:

  1. Service engineers will send a request to Xiaomi to generate unlock code (can take 1-3 days).

Cost: In official services, unlocking is usually free if the phone is warranted. In informal workshops, the price varies from 500 to 2000 rubles.

⚠️ Note: Some β€œservice centers” offer a loss of data firmware unlock, making it the only option. Always check if the information will be stored and require written confirmation.

5. Bypassing the lock via Safe Mode (temporary solution)

If you need to access your phone urgently (e.g., take a call or read an SMS), you can try logging into Safe Mode, which disables all third-party applications, including some lock modules.

Instructions:

  1. On the lock screen, hold the Power button until the off menu appears.
  2. Tap and hold the β€œPower off” option until the prompt to switch to Safe Mode appears.
  3. Confirm the transition. The phone will reboot.
  4. In some cases, a graphical key is not requested in Safe Mode, or a standard unlock slider appears.

Limitations:

  • ❌ It does not work on all models (e.g. Poco). X3 Pro and Redmi. 9T The method often works, but on the Mi 11 Ultra it does not).
  • ❌ After the release of Safe Mode, the lock will return.
  • ❌ Many functions do not work in this mode (Wi-Fi, Bluetooth, some system applications).

If the method works, copy the important data to another medium while the phone is in Safe Mode.

Comparison of Xiaomi Unlocking Methods

MethodData retentionConditions requiredDifficultyTime.
Through the Mi Account.βœ… Yes.Linked account, Internet⭐5-10 minutes
ADB/Fastbootβœ… Yes (unless encrypted)Unlocked bootloader, debugging by USB⭐⭐⭐15-30 minutes
TWRP (delete gesture.key)βœ… Yes.Installed TWRP, unlocked bootloader⭐⭐⭐⭐20-40 minutes
Service centreβœ… Yes.Documents on the phone, official service⭐⭐1-3 days
Safe Mode❌ No (temporary access)No additional conditions⭐2-5 minutes

What do you do if nothing helps?

If all of these methods fail, there are two options:

  1. Hard reset via Recovery. Delete all data, but return access to the phone. To do this: Turn off the phone. Press Power button + Volume up to enter Recovery. Select Wipe Data β†’ Wipe All Data. Confirm the reset.

Firmware via Mi Flash Tool.

Suitable if resetting via Recovery does not help (for example, due to damaged firmware). Requires a PC, cable and official firmware from the Xiaomi site.

1. Download the Mi Flash Tool and firmware for your model.


2. Log in to Fastboot (Power button + Volume down).




3. Connect your phone to your PC and run through Mi Flash (select "Clean All").

⚠️ Note: On models with a MediaTek processor (e.g. Redmi) 10A, Poco M4 Pro firmware via the Mi Flash Tool can result in a hard brick if the wrong firmware version is selected. Always check for model code compatibility (Settings) β†’ The phone. β†’ Model).

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging wasn’t enabled?
No. All data-saving methods (ADB, TWRP) require USB debugging to be activated beforehand, and if it's turned off, you can only unlock it through Mi Account (if it's tied) or contact the service center.
Why does the phone ask for a password when downloading after reset via TWRP?
This means that the /data partition is encrypted. Starting with Android 10, Xiaomi defaults to encrypt user data, in which case unlocking without data loss is impossible - a factory reset will be required.
How do I know if my Xiaomi bootloader is unlocked?
Turn off your phone and log in to Fastboot (Power button) + Loud down. Connect to your PC and execute the command: fastboot oem device-info If the answer has a line Device unlocked: true, the bootloader is unlocked. If false is locked.
What if, after unlocking through Mi Account, the phone again requests a pattern lock?
This is a bug in some versions of MIUI. Try: Sign in to Mi again. Reboot your phone. If it doesn't work, reset your pattern lock via i.mi.com (Device Management section).
Can I unlock Xiaomi through Google Account like I do on other Androids?
No. Since MIUI 9, Xiaomi has removed the ability to unlock through Google Account. The only official way is through Mi Account.