When Xiaomi’s smartphone is stopped because of a forgotten password, it’s common for users to set up complex combinations to protect their personal data, but eventually forget them, falling into the trap of their own security. The lock screen becomes an insurmountable barrier, turning a modern device into a useless piece of plastic and glass.
There are several proven ways to solve this problem, ranging from standard reset via the recovery menu to the use of specialized debugging tools. The choice of the specific method depends on the version of the MIUI or HyperOS operating system, and whether the debugging mode over USB was enabled in advance. In this article, we will discuss all the current options in detail.
It is important to understand that most of the methods associated with forced deprotection will lead to the complete deletion of user data. Photos, contacts and applications will be erased, so the process must be approached consciously. If you have important information that you do not want to lose, it is worth first trying to remember the code or use the device search function.
Why the phone requires a code and what are the locks
Xiaomi’s Android security system offers multiple layers of protection, each with its own uninstalled features. PIN-A pattern lock is convenient because it is easy to draw from memory, but on a screen with cracks or when it is dirty, it can be read incorrectly.
Digital code is considered more reliable because the number of possible combinations is much higher, but it is the one that users forget most often, especially if they use long sequences of numbers. A mixed password that includes letters and symbols provides maximum protection, but requires input accuracy, which is not always convenient in a hurry.
Special attention should be paid to biometric protection, including face ID unlock and fingerprint, which are convenient, but the system always requires a backup digital code in case of sensor failure or reboot of the device, and this backup code is often forgotten by owners who are used to relying only on biometrics.
- 🔒 pattern lock – connecting points in a certain order on the screen.
- 🔢 PIN-code is a short sequence of 4-6 numerals.
- 🔣 Complex password – a combination of letters, numbers and special characters.
- 👤 Biometrics – unlocking by a face or fingerprint with a backup code requirement.
It's worth noting that after five failed attempts, the system locks the device for a certain amount of time, and with each successive series of errors, the waiting time increases, up to a few hours of complete lockdown, a protective mechanism that prevents brute-force code selection.
Standard Resetting with Recovery Mode
The most common and effective way to remove code from a Xiaomi phone is to perform a full reset via the Recovery Recovery menu, which is built into the firmware of each device and is available even when the screen is locked. It does not require access to the system to log in, just use a combination of physical buttons.
The process starts with turning off the smartphone completely. If the device responds to presses but doesn't let the menu, press the power button and select the switch off point. Once the screen goes out, you need to simultaneously press the volume button and the power button. Hold them until the Mi or Xiaomi logo appears.
⚠️ Warning: Before starting the procedure, make sure that the battery is at least 50%. interruption of the reset process due to battery discharge can damage system files and inability to turn on the phone.
When you get to the Recovery menu, you have volume buttons, and you have the power button to select, and you have to find the Wipe Data and select it, and then you have to choose Wipe All Data, which means you have to delete all the information completely.
☑️ Preparing for resetting through Recovery
Once confirmed, the formatting process will begin, which can take a few minutes, and when completed, the phone will automatically reboot, and you will see the screen of the initial setup as if you had just bought the device, and the lock code will be completely removed.
Using the Find Device feature from Xiaomi
If the Internet was pre-enabled on the blocked smartphone and the Mi Account was activated, you can use the cloud-based device search service, which allows you to remotely erase data and remove the screen lock without physically accessing the phone buttons, which is especially true if the volume buttons are faulty.
To do this, you need to go to the official website of the Xiaomi cloud service from any other device, such as a computer or tablet, enter the username and password from the Mi Account that was used on the locked phone, the system will determine the location of the device and offer available actions.
From the list of options available, select Wipe Data or Clean Device. Once the command is confirmed, the phone, if connected to the network, will receive a reset signal, which will delete all data, including the forgotten password, pattern lock and the contents of internal memory.
What to do if the phone is offline?
It's a theft protection that you can't get around with simple methods, and if you don't remember your account password, it's going to be extremely difficult to restore access.
Google Find My Device Resets
The alternative is to use Google's standard service, which is built into most Android devices, which is similar to Xiaomi's cloud service, but it's linked to a Google account, which works if you're using geolocation and data on your phone.
Go to the Google Device Management page from any browser and log in to the account that is set up on your phone. From the device list, select your Xiaomi. If you have connection to the device, you will see the “Clean the Device” option.
Running this command will delete all data and remove the lock screen, but as in the previous case, after the reboot, the phone will ask you to enter a password from the Google account, a FRP (Factory Reset Protection) security measure designed to protect the owner’s data in the event of theft.
| Method | Conditions required | Data retention | Difficulty |
|---|---|---|---|
| Recovery Mode | Working buttons | No. | Low. |
| Mi Cloud | Internet, Mi Account | No. | Medium |
| Google Find | Internet, Google account | No. | Medium |
| ADB Command | USB debugging | No. | Tall. |
Using third-party software to unblock without losing data is often a myth or requires special rights that the average user does not have.
Removing the lock via ADB (for advanced)
For users who have previously enabled debugging mode USB (USB Debugging, in the developer menu, is a more gentle method that allows you to delete the file with the access keys without completely resetting the device, saving photos and contacts.
You first need to download and install ADB drivers on your computer, and you need to connect your phone with a cable, and if you have a request for debugging permission on your phone screen, you can't unlock it because the screen is locked, and this only works if you've given permission before and the computer is on your trusted list.
Open the command line or terminal on your computer and enter a command to delete the key file.The path to the file may vary depending on the Android version, but the following instruction is most often used:
adb shell rm /data/system/gesture.keyIf the file is successfully deleted, you need to restart the device. Once enabled, you can enter any graphical key or password and the system will let you inside. In some cases, you may also need to delete the locksettings.db file.
💡
If the command does not execute, check if the ADB is installed correctly. Type 'adb devices' - if the list shows a device labeled 'unauthorized', then access is denied and the method will not work.
It is worth noting that on newer versions of Android 11 and above, as well as in the HyperOS shell, security is significantly enhanced. Key files can be encrypted or hidden, making this method unworkable without root rights. Root rights, in turn, give full control over the system, but obtaining them on a locked phone is impossible.
What to do if your phone requires an account after a reset
After successfully resetting with any of the methods described, you will encounter the screen of the initial setup. The security system will ask you for confirmation of ownership of the device, this may be a Google account or Mi Account, which was synced with the phone before locking.
If you remember the login details, just enter your login and password. This is standard procedure, and after that the phone will be fully unlocked and ready to use. Problems arise if you don't remember the data or bought the phone from your hands and the previous owner didn't untie the device.
If a Mi Account password is forgotten, you can try to restore it through the site using a linked phone number or email. If the number is lost or unavailable, the recovery procedure can take a long time and require the receipt of purchase checks to be used in support.
⚠️ Attention: Attempts to bypass the account lock using paid services or flashing can lead to a complete lock of the device on the Internet. IMEI. Be careful about “unblock for money” offers online.
For devices purchased officially in stores, proof of ownership is often a check or warranty card, and keep these documents as they are the only legal way to prove ownership in case of account problems.
💡
Recovery removes the lock code, but activates account protection, without entering the correct data of Google or Mi Account, it will be impossible to use the phone.
Prevention and backup
To avoid such situations in the future, it is recommended to regularly back up important data. Xiaomi smartphones have a built-in application “Mi Backup”, which allows you to save data to your computer or to the cloud, and you can also use synchronization with Google Photos and Google Contacts.
Write your passwords in a secure place, whether it's a paper notebook you keep at home or a password manager, and using biometrics doesn't eliminate the need to remember the digital code, because it's the master key to the system.
Check regularly to see if your account is active and synced, make sure that the phone number and email associated with your account are up to date and accessible to you, allowing you to quickly restore access in a critical situation without losing data.
Simple digital hygiene practices can help keep your device accessible in any situation, and protection technologies are becoming more complex, but management tools are also more convenient if used correctly.