The situation when Xiaomi smartphone suddenly stops letting the owner inside the system is familiar to many, the lock screen becomes an insurmountable barrier, behind which are important contacts, photos and work files, most often due to trivial forgetfulness or rush, when the user installs too complex combinations and then can not reproduce it.
Unfortunately, modern Android security systems are designed so that simply “learn” or “see” a forgotten pattern lock is impossible to protect personal data. However, there are proven methods of bypassing locks or completely resetting settings that will return access to the device. In this article, we will examine all the current methods, from standard Google tools to specific features of the MIUI shell.
It is important to understand that the choice of method depends on the version of the operating system, the presence of a Mi Account tied and the USB debugging enabled. Some methods allow you to save data, others require full formatting. We will consider each option in detail so that you can choose the most suitable for your case.
Use the “Forgot Password” function through Google Account
The easiest and safest way to restore access is for devices running relatively older versions of Android (up to 5.0 inclusive) or under certain security settings. If your phone is connected to the Internet and Google profile is activated, the system will offer an alternative sign-in option after several failed attempts.
After five incorrect pattern lock inputs, the lock screen usually shows a button called "Forgot your pattern lock?" or "Forgot your password?" and clicking on it will show you a login and password field from your Google account, which is the same account that was the main one on the device when you installed the lock.
If the data is entered correctly, the system will suggest a new way to protect or completely remove the lock, but on modern versions of MIUI and Android, this feature is often hidden or removed for security reasons, so this method does not work on all models.
- 🔑 Enter the wrong key 5 times in a row to activate the waiting timer.
- 📡 Make sure your smartphone is connected to Wi-Fi or mobile network.
- 📧 In the field, enter the email and password from the main Google account.
- ✅ Create a new combination or select unlock by fingerprint.
💡
If the “Forgot Password” button doesn’t appear even after many attempts, then on your version of MIUI this method is disabled by the manufacturer and you need to look for other solutions.
It is worth noting that after successfully unlocking through Google, the system may take some time to sync data. Don’t rush to perform a hard reset immediately if the device responds to commands. Sometimes waiting for 15-30 minutes helps, after which the lock can be removed automatically if you have a stable connection.
Delete the key file via ADB and debug over USB
This is considered one of the most effective methods for advanced users, but it requires preliminary preparation, the main condition is that the smartphone must be pre-enabled debugging by USB in the menu “Developers”, if you do not activate this feature before blocking, this method, alas, will not work.
The method is to delete the system file gesture.key or password.key, which stores the hash amount of your pattern lock, USB-cable and installed drivers ADB. By connecting your phone to your PC, you access the file system via the command line.
⚠️ Warning: Before starting, make sure the battery is at least 60% charged. interrupting the process of deleting system files can cause the device to reboot cyclically.
To do this, open the command line on your computer and type in the sequence of commands. First, check the connection of the device with the adb device command. If a device with device status appears on the list, then the connection is established. Then you need to log into the Android shell.
adb shell
cd /data/system
rm gesture.key
rm password.key
rm locksettings.db
rm locksettings.db-wal
rm locksettings.db-shmAfter these commands, the key file will be deleted. Now just reboot the smartphone. When you turn on, you can enter any pattern lock or password - the system will miss you, since the verification file is destroyed. Immediately after logging in, it is recommended to install a new lock.
☑️ Pre-use checks ADB
In some cases, especially on newer versions of MIUI, access to /data/system can be restricted even with ADB rights without root rights. If commands return a "Permission denied" error, then the method will not work without an unlocked bootloader, which is impossible to do in a locked state.
Reset via Google’s Find My Device service
Google provides a built-in remote device management tool that can be useful in a critical situation. Find My Device not only tracks the location of a lost phone, but also performs a remote data cleanup, which automatically removes the screen lock.
To use this method, you need to log in to your Google account on a locked phone, turn on the Internet and activate geolocation. Go from any other device (computer or tablet) to the android.com/find website and log in under the same account.
In the service interface, select your device from the list, and you'll have a few actions available: "Call," "Block," and "Clear Device." We're interested in the last item. Once the operation is confirmed, the phone will receive a command to completely reset (Wipe Data).
- 🌍 Open your browser on another device and go to Find My Device.
- 🔐 Log in to the Google account that was used on the blocked Xiaomi.
- 📱 Select the desired device at the top of the screen.
- 🗑️ Click the “Clean the Device” button and confirm the action.
What happens to the data after cleaning?
Once the process is complete, the phone will restart. There will be no lock on the screen, but all the data will disappear. If the device has been synced, you can restore contacts and photos by logging into your Google account after setting up.
Unlocking through Mi Cloud (Find Device)
Xiaomi smartphone owners have the advantage of their own ecosystem: Mi Cloud (or Find Device) provides similar features to Google, but often works more stably on the devices of this brand, the main condition is the presence of a tied Mi Account and the enabled feature “Search for Device”.
Go to i.mi.com from your computer or other smartphone. Sign in using your Mi ID. From the menu, select "Device Search" section. If your phone is online, you'll see it on the map.
Unlike Google, Xiaomi sometimes allows you to not only clear your data, but also unlock the screen without losing files if this option was activated in advance, but in most cases, you will need the “Erase Data” function to remove the forgotten key.
| Function | Data retention | Requirements | Probability of success |
|---|---|---|---|
| Find My Device (Google) | No (Full reset) | Google account, Internet | Tall. |
| Mi Cloud (Xiaomi) | No (usually) | Mi Account, Internet | Tall. |
| ADB (gesture.key) | Yes. | Debugging by USB, PC | Medium |
| Recovery Mode | No. | Physical access | 100% |
💡
Mi Cloud is the most preferred service for Xiaomi owners, as it is more integrated into the system and often bypasses the restrictions imposed by Google.
This is Action Lock, and if you don't remember the password from your Mi Account, it will take longer to recover through the process of retrieving your account on the site.
Hard Reset via Recovery Mode
If no software method works, the most radical but always working method is Hard Reset, which resets the phone to factory settings, removing all user data along with the forgotten key.
On Xiaomi smartphones, Recovery is logged in by a combination of buttons when the device is off, usually by pressing the volume button "Up" and the power button, and some models may require a charger to be connected.
In the Recovery menu, you can use volume buttons (up/down) and power buttons (select). You can find Wipe Data or Clear Data. Newer versions of MIUI may require you to enter a special code that shows up on the screen, confirming that you are acting consciously.
⚠️ After resetting via Recovery on modern Android (version 5.1 and above), protection will work FRP (Factory Reset Protection: The phone will require you to enter a Google account that was previously synced.
The cleaning process takes anywhere from 10 seconds to a few minutes. Once complete, select Reboot or Reboot to System. The phone will turn on as new, suggesting you choose a language and connect to Wi-Fi.
- 📴 Turn off your smartphone completely.
- 🔘 Press the "Loudness Up" button» + «Nutrition».
- 🛠️ In the Recovery menu, select Wipe Data → Wipe All Data.
- 🔄 Confirm the action and wait for the end, then restart.
Note that on devices with a locked bootloader, the entrance to Recovery may be limited or require confirmation of the lock screen password (on some versions of MIUI), in which case only flashing through Fastboot will help.
Unlock the bootloader and firmware through Fastboot
For users who encounter FRP (Google account) lock after a reset or cannot log in to Recovery, the firmware method remains.The official method requires an unlocked bootloader, which cannot be done without accessing the phone's menu unless presets have been made.
However, if the bootloader has been unlocked before (which is often done by custom firmware enthusiasts), you can flash the device clean. This uses the Mi Flash Tool and the Fastboot firmware image. Log in to Fastboot on Xiaomi is done by pressing the "Loudness Down" + "Power" button.
In Fastboot mode, connect your phone to your PC. In the Mi Flash Tool, select the path to the unpacked firmware and press the Flash button. It is important to select the Clean All mode to erase all memory partitions, including those where lock data is stored.
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot rebootThis method is technically complex and requires you to find a specific firmware for your model. An error in choosing a version of the software can lead to the "fixing" of the device. Use this method only if you are confident in your actions and file compatibility.
Can I unlock the bootloader without accessing the menu?
If none of these things worked, maybe the problem is that the hardware malfunctions in the touch layer or the plume, and in rare cases, the dead zone of the screen matches the key point. USB-mouse-over OTG, typing a pattern lock with a cursor.