How to remove the pattern lock from Xiaomi if you forgot: a step-by-step guide

When you pick up your Xiaomi and realize you canโ€™t unlock the screen, itโ€™s a panic attack for anyone.In a rush or stressful situation, itโ€™s easy to forget the complex graphical pattern youโ€™ve come up with to protect your personal data. Modern smartphones, especially those with a MIUI or HyperOS shell, come equipped with robust security systems that lock the device after several failed input attempts.

But donโ€™t despair, as there are several proven ways to restore access to the gadget. The choice of the specific method depends on whether the Mi Account was enabled, whether the debugging is activated over USB and which version of the operating system is installed on your device. In this article, we will discuss in detail all possible options, from the simplest to the most radical, so you can regain control of your phone.

Before you start taking action, it is important to understand that some methods can lead to complete deletion of data. If you do not have a backup, try first to try methods that do not require resetting. Data security is a priority, but accessing the device sometimes requires decisive steps.

Using a Mi Account to Unblock

The easiest and safest way for Xiaomi smartphone owners is to use a linked account. If you have previously logged in to your profile on the device and the phone has an internet connection, the system can offer unlocking via a cloud service. This only works if the Find Device feature has been activated in advance.

After five incorrect attempts to enter the pattern lock, a countdown timer will appear on the screen, at which point you will see a button "Forgot the key" or "Forgot the password." When you click on it, the system will prompt you to enter the username and password from your Mi Account, which is not just a formality, but a serious security mechanism that confirms that the device is owned by an authorized user.

In some cases, especially on older versions of firmware, unlocking occurs immediately after successful authorization. However, on newer models with Android 11 and higher, this method may not be available due to enhanced security protocols. If the button does not appear or the server does not respond, you will have to resort to other methods.

What to do if you forget your Mi Account password?
If you don't remember the login details for your Mi Account, try to restore access through the official mi.com website, you'll need a phone number or email linked to your profile, and without re-accessing your account, the method of unlocking through the cloud will not work.

Resetting settings via Recovery Mode

If cloud unlocking is not possible, the only working option is Hard Reset, which will delete all user data, including photos, contacts and apps, but return the phone to factory status.

You need to turn off your smartphone completely. Then press the volume button and the power button at the same time. Hold them until the Mi logo appears, then release the power button, keep the volume up, and you will see the main Recovery menu, where the navigation is done with the volume button and the choice with the power button.

โ˜‘๏ธ Reset algorithm via Recovery

Done: 0 / 4

From the menu, select Wipe Data, then Wipe All Data. The system will alert you to loss of information. Confirm the action by selecting Confirm. The formatting process can take a few minutes. Once complete, select Reboot to restart the device.

โš ๏ธ Note: After resetting and rebooting, the phone may request a password from a previously used Google account or Mi Account (FRP), which cannot be bypassed by a simple discharge.

Removing the key via ADB (for advanced users)

For those who have pre-installed USB Debugging in the developer menu, there is a way to delete the key file without losing personal data.This method requires a computer with ADB drivers installed and the associated software. If debugging was not enabled before blocking, this method, alas, will not work.

Connect the locked smartphone to the PC through USB-Open the command line on your computer in the tool folder. ADB. Enter the adb device command to make sure the computer sees the device. If everything is connected correctly, the serial number of the phone will appear in the terminal.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/locksettings.db




adb shell rm /data/system/locksettings.db-wal




adb shell rm /data/system/locksettings.db-shm

Once you do these commands, you delete the files that store the pattern lock information. Then reboot the device. The lock screen must disappear, or you can enter any arbitrary pattern. This method is effective on devices without encryption or on older versions of Android.

๐Ÿ’ก

Use the original. USB-Cheap charging cables often do not support data transmission, leading to a connection error ADB.

Find My Mobile and Remote Management

An alternative to local methods is remote management via a web interface. Find My Mobile (or similar features in Mi Cloud) allows you to control the device remotely, which requires that the phone is turned on, connected to the network and authorized in the account.

Go to the cloud service site from any other device. In your list of gadgets, select a locked phone. In the action menu, find the option "Unlock." The system will send a command to the device that will forcefully remove the lock.

The effectiveness of this method varies depending on the version of MIUI. On some firmware, the remote unlock function has been removed for security reasons. However, it is definitely worth checking if this option is available in your account, since this is the most gentle way to save data.

Compatibility table of unlocking methods

To make it easier for you to navigate the available methods, we have prepared a summary table that will help you quickly determine which method is right for your situation, based on the current state of the device.

MethodWe need the Internet.Data retentionYou need a Mi Account.
Mi Account (screen)Yes.Yes.Yes.
Hard Reset (Recovery)No.No.No (but it's for FRP)
ADB teamNo.Yes.No.
Find My MobileYes.Yes.Yes.

As you can see from the table, data retention is only possible if security measures have been put in place in advance, and in most cases, when the key is forgotten, the only way out is to reset completely.

๐Ÿ“Š Can you unlock your phone without losing data?
Yes, through the Mi Account.
Yes, through ADB.
No, I had to do a reset.
I haven't tried it yet.

FRP protection and bypassing Googleโ€™s blocking

Once you reset, you may encounter the Google Factory Reset Protection (FRP), a mechanism that requires you to enter a Google account that was synced to your phone before the reset, and if you don't remember that, the phone will remain locked even after Hard Reset.

FRP bypassing is a complex technical procedure that often requires specific tools or vulnerabilities in a particular firmware version. There are helper programs such as Mi Unlock Tool (to unlock the bootloader) or specialized software to remove FRP, but their use requires caution.

โš ๏ธ Note: Using third-party software to bypass FRP The manufacturer may consider it a violation of the warranty conditions, and downloading such programs from unverified sources carries the risk of infecting the computer with viruses.

If you are the legitimate owner but canโ€™t remember your account details, try to restore access to Google email via a browser on a PC, often faster and safer than finding security exploits.

๐Ÿ’ก

FRP-The lock is designed to protect the owner's data in the event of theft, and circumventing this protection without the owner's account data is extremely difficult on modern versions of Android.

Prevention and backup

To avoid such problems in the future, it is important to set up the right backup system. Xiaomi offers built-in tools to synchronize contacts, messages and settings with the cloud. Regular creation of backups will allow you not to worry about the safety of information in case of any failures.

It is also recommended to write complex passwords to a secure location or use password managers. A pattern lock is convenient to draw, but easy to forget unless used often. Installing a fingerprint or facial recognition as an additional unlocking method will make it much easier to access the device.

Remember to check periodically if your Mi Account is active and synced with Google, which at a critical moment will be the key to regaining access to your digital life.

What if the phone is not in Recovery mode?
If the button combination doesn't work, make sure the device is completely off instead of in hibernation mode. USB-cable (connected to a PC or charger) during power on.Some models require three buttons to be pressed simultaneously.
Will the phone drop off after many attempts?
No, modern Xiaomi smartphones don't reset automatically after many incorrect key attempts; they only increase the lock time interval.
Can I unlock my phone through a print if I have forgotten my key?
After the device is restarted, the system always requires the primary lock method (key) to be entered, PIN-Biometrics (fingerprint or FaceID) only work after you have successfully entered your master password.
Is it safe to use third-party software to unlock?
Using unverified software carries risks: You can transfer your personal data to third parties or damage your phone's software. Official methods through Mi Account or Recovery are the only guaranteed safe options.