How to unlock a pattern lock on Xiaomi if you forget it

When you pick up a smartphone to answer an important call or check a message, and you see a lock screen that fails to overcome, it's familiar to many. Especially offensive is Xiaomi devices, where MIUI security can be set to automatically lock after several failed input attempts, at which point the user often panics, believing that access to contacts and photos is lost forever.

But the current mobile ecosystem provides a number of ways to address this problem: Depending on the version of the Android operating system, your Redmi or Poco model, and the settings you pre-installed, the algorithm will be different, there are methods to save data, and radical ways that require a complete reset.

In this article, we will take a look at all the current options, including standard recovery procedures through a Google account, as well as Xiaomi brand-specific solutions, including the use of Mi Cloud. It is important to understand that each step requires care to avoid aggravating the situation.

Unblocking methods through Google account

The most traditional and least disruptive way to regain access to a device is to use a Google account, which works if the smartphone is connected to the Internet (Wi-Fi or mobile data) and synced on it. After five incorrect attempts to enter the pattern lock or PIN-The system will offer the option “Forgot the key?” or “Forgot the password?».

By clicking this button, the system will require you to enter the username and password from the Google account that was the main one on the device, which is an Android security mechanism designed to prevent data theft, if you remember the login data, the problem is solved in a few minutes, otherwise you will need to restore access to the account itself through a computer or other gadget.

⚠️ Note: If your device has not been configured with an internet connection, this method will not work because Google servers will not be able to verify your data in real time.

It is worth noting that on new versions of Android (starting with version 9 and above), the “Forgot Password” functionality is often eliminated in favor of more stringent security measures, in which case the system will not offer to enter a password from the account immediately after blocking, but will require a complete reset. However, for devices with a version MIUI On Android 8 and below, this method remains the most effective way to save information.

If you successfully entered the data, the system will prompt you to create a new pattern lock or choose a different type of screen lock, after which the old key will be deactivated, and you will have full access to all the functions of the Xiaomi smartphone.

Using Mi Cloud for Remote Resetting

Owners of Xiaomi, Redmi and Poco smartphones have a unique advantage – the built-in Mi Cloud service. If the Mi Account was enabled on the locked device and the Find Device function is activated, you can unlock the screen remotely through the browser on your computer or other phone.

To do this, you need to go to the official website of the Mi Cloud service and log in under the same account3unt as on the locked gadget. In the device management interface, you need to select your model from the list and find the option “Block” or “Erase Data” option. Choosing the option “Erase Data” will lead to the complete removal of the pattern lock along with all files.

☑️ Check before using the Mi Cloud

Done: 0 / 4

However, there is a nuance that makes this method unique to Xiaomi: In some versions of MIUI firmware, the remote unlock feature allows you to remove the key without losing data if the device is on the network.

The process is as follows:

  • 📱 Enter Mi Cloud from any device.
  • 📡 Select your locked phone from the Find Device menu».
  • 🔓 Click the “Unlock” button (if available) or “Clean the device” button».
  • ⏳ Wait for the command to be executed, after which the phone will restart or immediately let on the desktop.

This is a theft protection known as Mi Account Lock.

Resetting settings via Recovery Mode

If the software methods are not available through accounts, the only guaranteed way is to completely reset your settings through Recovery Mode, which will return the phone to factory status by removing all user data, including the pattern lock, photos, contacts and apps.

To enter recovery mode on most Xiaomi models, you need to turn the device off completely. Then you need to pinch the combination of buttons: usually Volume Up + Power Button. Hold them until the Mi logo or Recovery menu appears. In some cases, you may need to connect the charging cable.

Model/SeriesButton combinationFeatures of the menu
Redmi Note 8/9/10Volume Up + NutritionClassic Recovery Menu
Xiaomi Mi 9/10/11Volume Up + NutritionConfirmation of discharge required
Poco X3 / F3Volume Up + NutritionYou may need to enter a code.
Older models (Mi 5/6)Volume Up + NutritionQuick entry into mode

Once you enter the menu, the navigation is done with volume buttons (up/down), and the choice is confirmed by the power button. You need to find Wipe Data or Clear User Data. New versions of MIUI may require you to enter a special confirmation code that appears on the screen to prevent accidental reset.

What to do if Recovery requires a password?
In the new versions MIUI (12, 13, 14) when you try to log in to Recovery or reset, you may be asked for a password from the Mi Account.If you do not remember it, it is officially impossible to restore access without data loss due to Xiaomi's security policy. ADB In such cases, as a rule, do not work without prior debugging of the USB.

Once the Wipe All Data is confirmed, the phone will clear the internal memory and restart, a process that can take minutes, and be prepared for the device to look like you just took it out of the box.

📊 What kind of unlocking method have you tried?
Through a Google account
Through the Mi Cloud
Reset via Recovery
Calling the service

Use the services of Find My Device

An alternative to Xiaomi’s own cloud is Google’s standard service, Find My Device, which is effective if the phone has geolocation and internet activated, but you can’t log in to Mi Cloud or hasn’t been configured.

Go to the service site from any computer, enter the Google account associated with the phone. In the list of devices, select your Redmi or Mi. You will be prompted by three actions: “Call”, “Block” and “Clear the device”.

The Lock option allows you to set a new temporary password that will replace the forgotten pattern lock. However, on modern versions of Android, this feature often works unstable or is absent, leaving only the option of complete cleaning. If you choose Clean the device, the phone will be reset to factory settings, similar to the method through Recovery.

The advantage of this method is that it is cross-platform and independent of Xiaomi servers.It works even if the Mi Account was not created, making it a versatile tool in the user's arsenal.

Unlocking through USB debugging (ADB)

This method is suitable only for advanced users and only if the locked phone was pre-enabled Debugging. USB (USB Debugging) in the Developer menu, if this option was not activated before blocking, this method is useless.

The method is to delete the gesture.key or password.key file, which stores the hash of the pattern lock, through the command line on the computer, which requires installing ADB drivers on the PC, connecting the phone with a cable and starting the console.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/password.key

Once the commands are executed, you need to restart the device. Any arbitrary key or password can be entered on the lock screen and the system will let you through. However, as mentioned, on Xiaomi phones with new security versions, access to the file system via ADB without authorization on the device itself (pressing “Allow” on the phone screen) is often closed, making this method unworkable in 90% of lock cases.

⚠️ Note: Attempts to use third-party programs to crack the key through ADB This can damage system files and turn the phone into a brick. Use only proven key file removal commands.

Prevention and backup

To prevent a forgotten key from taking you by surprise, it is important to set up a security system in advance. The most reliable way to protect data is by regularly backing up. Xiaomi smartphones have a built-in app called Mi Backup that allows you to save data to your computer or to the cloud.

You can also set up biometric unlocking, and a fingerprint or face ID allows you to bypass the pattern lock in everyday use, and even if you forget the pattern, the biometrics will give you access to the system, and then you can change the password in the settings.

💡

Set up Smart Lock in your security settings, which will allow your phone to remain unlocked when it’s in your pocket, connected to a smartwatch, or in your home’s trusted Wi-Fi area.

Remember to write complex passwords to a secure location or use password managers.The human memory is imperfect, and complex combinations that are easily forgotten are better stored digitally or paper-based off the phone.

💡

Regular sync with Google Photos and Google Contacts will save your data even in the event of a complete device reset.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without losing data?
Yes, this is only possible in two cases: if the method works through a Google account (on old Android) or if remote unlocking through Mi Cloud works without erasing data.
What if your phone says “too many attempts”?
The security system blocks the input for a certain time (30 seconds to several hours). You need to wait for the timer to end. If the lock is long (24 hours), try to restart the device, but the timer may not reset.
Will Mi Account Reset After Settings Reset?
No, the Mi Account is linked to the device's hardware identifier, and once you reset the settings, the phone will require you to enter the username and password from the previously used Mi Account to confirm ownership.
Will the phone flashing help?
Officially flashing the Mi Flash Tool in Fastboot mode will completely clean the phone, including the pattern lock. However, it is a complex process that requires an unlocked bootloader that cannot be unlocked without access to the system.