Forgot your Xiaomi password and can't unlock your phone? This is a familiar situation for many people, just once enter the wrong pattern lock or PIN-The code, and the device locks for 30 seconds, a minute, or forever. Fortunately, the manufacturer has provided several formal and informal ways to reset the password without losing data (or with minimal loss, POCO Mi β from simple recovery via Mi Account to complex manipulations ADB and Fastboot.
Itβs important to understand that not all methods are suitable for new models with FRP (Factory Reset Protection) protection. For example, resetting via Recovery Mode on Xiaomi 13 Pro or Redmi Note 12 will require entering the username and password from Mi Account after rebooting. So we will separately look at the workarounds for devices with MIUI 14+ and older versions of the firmware. If you do not remember the data from the Xiaomi account, immediately go to the section about EDL Mode is the only way to bypass the lock on modern devices.
Before you start, check:
- π Battery level (should be at least 30% - when discharged during resetting, the phone can turn into a "brick").
- π‘ Backup (if the data is not synced with Mi Cloud, you may lose it).
- π§ Access to a computer (for methods with ADB Fastboot will require a PC with Windows/Linux).
1 Unlocking through Mi Account (official method)
The easiest and safest method is to use a Xiaomi account, which works if:
- π± The phone is connected to the Internet (via Wi-Fi or mobile network).
- π Remember the username and password from Mi Account.
- π² The device is synchronized with Mi Cloud.
Instructions:
- On the lock screen, enter the wrong password 5 times in a row, and the message will appear: "Forgot the password?".
- Click on the Forgot Password button? β Select Restore via Mi Account.
- Enter the email or phone number associated with the account and the password.
- Confirm unlocking via SMS or email (if two-factor authentication is enabled).
β οΈ Note: If you have previously disabled sync with Mi Cloud or changed firmware to custom (for example, LineageOS), this method may not work.
2. Reset password via Recovery Mode (without loss of data)
The method is suitable for devices on MIUI 12 The new versions require you to enter Mi Account data after reset, and the essence of the method is to delete the gesture.key file or password.key, which stores information about the pattern lock./PIN-code.
Step-by-step:
- Turn off the phone by pressing the power button.
- Press the Volume Up + Power combination (on some models Volume Down + Power) and hold for 10-15 seconds until the Mi logo appears.
- From the Recovery Mode menu, select the language (usually English) and go to Advanced β File Manager.
- Open the folder. /data/system/ and find files: gesture.key (for pattern lock), password.key (for pattern lock) PIN-code), locksettings.db (for password).
Delete
Reboot β System
Once rebooted, the password will be reset, but all data will remain in place (unless other files have been deleted).On MIUI 13/14, this method only works when FRP is disabled.
Store charge >30% | Download ADB drivers (in case of errors) | Check phone model (button combinations differ) | Prepare backup (if you have access to Mi Cloud)
-->
3. Use of ADB (for unlocking without resetting)
If your phone has USB debugging enabled (even if it is locked now), you can reset your password via ADB (Android Debug Bridge), which works on any MIUI version, but requires pre-preparedness.
What you need:
- π₯οΈ Computer with Windows/Linux/macOS.
- π USB-cable (original, without damage).
- π¦ Installed drivers Xiaomi and ADB.
Instructions:
- Connect the locked phone to the PC.
- Open the command line (Win + R β enter cmd).
- Enter the commands in turn: adb devices (should display your device). adb shell su rm /data/system/gesture.key (for a pattern lock) or rm /data/system/password.key (for PIN-code).
- Reboot the phone: reboot
β οΈ Attention: If debugging is on USB It wasn't on in advance, it won't work (POCO X3 Pro, Redmi K40) Root rights are required that void the warranty.
π‘
If the su command doesnβt work, try first entering adb shell rm /data/system/locksettings.db β this will remove all lock settings.
4.Reset to factory settings via Fastboot
If previous methods failed, it's hard to reset through Fastboot, which removes all data from your phone, including photos, contacts and apps, and only use it as a last resort!
How to reset:
- Turn off the phone.
- Press Volume Down + Power for 10 seconds until the hare in the eardress hat (Fastboot logo) appears.
- Connect your phone to your PC and open the command line.
- Enter the commands: fastboot devices (connection check), fastboot erase userdata (delete user data), fastboot erase frp (reset FRP if required), fastboot reboot (reboot).
After the reboot, the phone will be like new β you will need to reconfigure MIUI and restore data from the backup (if any).
| Method | Mi Account required | Loss of data | Difficulty | Suitable for MIUI 14+ |
|---|---|---|---|---|
| Recovery through Mi Account | β Yes. | β No. | β | β Yes. |
| Delete gesture.key in Recovery | β No. | β No. | ββ | β No (requires) FRP) |
| ADB (if debugging is enabled) | β No. | β No. | βββ | β Yes. |
| Fastboot (hard reset) | β No (but you will need to do it when you are set up) | β Yes. | ββ | β Yes. |
| EDL Mode (for new models) | β No. | β Yes. | ββββ | β Yes. |
5. Unlock via EDL Mode (for new Xiaomi)
The only working way to get around FRP on Xiaomi 12/13, Redmi Note 11/12 and POCO F4/F5 is to use EDL (Emergency Download Mode) mode, which requires a special cable or short circuit of contacts on the board, so it is better to trust professionals, but if you have the skills you can try it yourself.
What you need:
- π§ EDL-cable (or paper clip for closing contacts).
- π₯οΈ Mi Flash Tool and firmware for your model.
- π Disabled Mi Account (if the phone was linked to the account, you will need authorization after firmware).
Instructions:
- Turn off the phone.
- Connect. EDL-cable (or close the contact test point on the board).
- Connect the phone to a PC, and it will be defined as a Qualcomm HS-USB QDLoader 9008.
- Start the Mi Flash Tool, select the firmware and press Flash.
- Wait until the end (10-15 minutes).
β οΈ Note: Incorrect Firmware Through EDL If you are not sure about your actions, contact the service center. On new models (Xiaomi 14, Redmi Note 13), this method may require authorization through Mi Account even after firmware is installed.
What is FRP and why does it prevent resetting?
6. Alternative methods (if nothing helps)
If the standard methods donβt work, try:
- π Contact Xiaomi Service Center β they can unlock the phone by serial number (you need a check or box).
- π Restore access to Mi Account with Xiaomi support (if you forgot your password).
- π οΈ Use third-party utilities like Mi Account Unlock Tool (risky - can lock the phone forever).
Forums often recommend using programs like Dr.Fone or iMyFone LockWiper, but they are:
- β They do not work on new models with MIUI 14.
- β May contain viruses.
- β Costs money (from 30)$ 100$).
It is better to spend time on official methods or consult specialists.
π‘
On Xiaomi with MIUI 14+, the only working ways are to restore via Mi Account or firmware in EDL Mode. Other methods either wonβt work or will result in a complete lockdown of the device.