Forgot the pattern lock or PIN-Does the phone lock after failed typing attempts? Don't panic - there are several official and alternative ways to remove the password without losing data (or with minimal loss). In this article, we will discuss 5 proven methods, including unlocking through Mi Account, resetting to factory settings, using the ADB and even bypass locking on old models without linking to the account.
It is important to understand that the effectiveness of the method depends on the version of MIUI, the model of the smartphone (for example, Redmi Note 10 vs POCO F5) and whether previously enabled features like Find My Device or debugging on USB. We will describe in detail each option β from the simplest to technically complex β and also warn about possible risks (for example, models with a MediaTek chip after reset may require authorization of the previous Google account).
If you're looking for a way to get around the lock without losing data, you can go straight to the Mi Account or ADB sections. If the phone doesn't respond to the password at all, you'll have to consider a full reset, and let's start with the safest method.
1 Unlocking through Mi Account (official method)
This is the only legal method approved by Xiaomi that works on most modern devices (e.g. Redmi 12, POCO X5 Pro, Xiaomi 13T).The main condition is that the phone must be linked to the Mi Account before locking, and you must have access to the email or phone number specified during registration.
Algorithm of action:
- πΉ Enter the wrong password 5 times in a row until the message βForgot password?β appears (or βForgot password?β on the English firmware).
- πΉ Click on this inscription and the Mi Account entry window will open.
- πΉ Enter your username (email or phone) and password from your account. If you don't remember your password, use the recovery function at account.xiaomi.com.
- πΉ After successful authorization, the system will offer to create a new PIN-code.
β οΈ Attention: On devices with MIUI 14+ After unlocking through Mi Account, additional verification may be required SMS If you have two-factor authentication, make sure you have access to the backup code.
2. reset to factory settings (Hard Reset)
If you don't remember the Mi Account data or the phone isn't tied to the account, the radical method is a complete reset, which will delete all the data (photos, contacts, messages), but unlock the device, which works on all Xiaomi models, including the Redmi 9A, POCO M4 Pro and older devices.
Instructions for resetting via Recovery Mode:
- Turn off the phone (press the power button for 10 seconds).
- Press the power button + volume up at the same time and hold for 10-15 seconds until the Mi logo appears.
- In the Recovery menu, select Wipe Data (use volume buttons for navigation, power button for confirmation).
- Confirm the reset by selecting Wipe All Data.
- After the process is complete, select Reboot.
β οΈ Note: On devices with MediaTek chip (e.g. Redmi) 8A, Redmi 9C) After the reset, a request may appear to enter data from the previous Google account (FRP-To avoid this, remove the reset before resetting. SIM-map and turn off Wi-Fi.
βοΈ Preparing for Xiaomi's reset
3. Unlock through ADB (for advanced users)
If the phone has USB debugging enabled (Settings β About Phone β MIUI version, tap 7 times to activate the developer mode), you can delete the file with the password through the computer. The method works on MIUI 12-14, but requires preliminary preparation.
Step-by-step:
- Connect your phone to your PC through USB-cable (original!).
- Open the Command Prompt (Windows) or Terminal (Mac/Linux) in the folder with ADB.
- Enter the commands in order: adb devices (to display your device) adb shell su rm /data/system/gesture.key rm /data/system/password.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot
- After resetting, the password will be reset.
π§ Technical note: On MIUI 14 The path to the lock files may be different. If the commands don't work, try deleting the files in the folder. /data/system/ with the extension *.key.
What if the ADB canβt see the device?
4.Block bypass via Fastboot (for models without Mi Account)
Some older Xiaomi models (e.g. Redmi 4X, Redmi Note 5) can reset passwords through Fastboot mode without losing data.
Instructions:
- π Turn off the phone and press the power button. + Volume down to enter the Fastboot.
- π Connect the device to the PC and open the Command Prompt in the folder with ADB.
- π Enter the command: fastboot oem unlock (some models may require fastboot flashing unlock).
- π Once you unlock the bootloader, enter: fastboot erase userdata and fastboot erase frp.
- π Reboot your phone with the fastboot reboot command.
β οΈ Attention: Unlocking the loader (OEM Unlock resets all data on the device and can cause a phone to break if the process is interrupted. (Xiaomi 12, POCO F4) This method may not work due to hardware protection.
5. Alternative methods (for specific cases)
If standard methods donβt help, consider these options:
| Method | Suitable for | Risks. | Instructions |
|---|---|---|---|
| Resetting through Find My Device | Devices with Find My Device enabled and access to Google account | Deletion of all data | Go to google.com/android/find, select your device and click βClean your deviceβ. |
| Passage EDL-regime | Phones on Qualcomm (e.g. POCO X3, Redmi K40) | High risk of brik, requires author firmware | Needed. EDL-cable and the Mi Flash Tool. Details on the forums 4PDA or XDA-Developers. |
| Delete the lock files via TWRP | Devices with installed custom TWRP Recovery | Losing data if you donβt backup | In TWRP, go to Advanced β File Manager and delete /data/system/gesture.key and password.key files. |
π‘ Useful tip: If you often forget passwords, set up Smart Lock in Settings β Screen locking β Smart Lock: This feature will automatically unlock the phone in trusted locations (like at home) or when connected to trusted devices (like Mi Band smartwatches).
π‘
Before selling a Xiaomi phone, always reset via Settings β About Phone β Reset, not Recovery.This will remove the binding to the Mi Account and avoid problems for the new owner.
Frequent Mistakes and How to Avoid Them
Many users experience typical problems when trying to unlock, and here are the most common:
- π« Error "This device is locked" after reset: means it is enabled FRP-The solution is to enter your old Google account or use tools like FRP Bypass Tool (risky!).
- π« ADB Does not see the device: check if debugging is enabled USB, If you have drivers installed, try another cable.
- π« After the discharge, an old one is required PIN: On some models (Redmi Note 8 Pro) after Hard Reset can save the request for the old password.
- π« Mi Account unlocking does not work: make sure your phone is connected to the Internet (via Wi-Fi or mobile network). If your account is blocked, restore access to the Xiaomi website.
π Diagnostics: If none of the methods worked, determine the exact phone model and version MIUI (It's written on a box or in settings. POCO F3 on MIUI 13 and Redmi. 9T on MIUI 12.5 Different approaches may be required.
π‘
On devices with MIUI 14+ and MediaTek chip (e.g. Redmi) 10C) After reset, you may need to log in to your previous Google account. To avoid this, turn off your Wi-Fi before reset and retrieve it. SIM-map.