How to remove a pattern lock from Xiaomi: the complete guide

The situation when Xiaomi smartphone stops letting the owner into the system is familiar to many. The lock screen becomes an insurmountable barrier, especially if the graphic pattern was complex or the device was long without use. You should not panic at this point, since modern versions of MIUI provide several scenarios for restoring access. The choice of the specific method depends on whether the phone is tied to the account and whether debugging is enabled via USB.

Before you start radical action, you need to assess the risks. Some methods involve a complete data cleanup, others allow you to save information, but require prior preparation. Self-resetting the password through the engineering menu without a backup will lead to the irretrievable loss of all photos and contacts. Carefully study each option to choose the most suitable for your situation.

Next, we will look at the current ways to bypass the lock, ranging from regular recovery tools to more complex technical manipulations. It is important to understand that data security in Xiaomi is the first place, so the system will resist unauthorized access attempts.

Using Mi Account to Unblock

The most civilized and safe way to restore access is to use a Mi Account, which is connected to the device, and if the device has activated the Internet and enabled the Find Device function, the system allows you to reset the lock remotely, which does not require cable connection and complex manipulation of the code.

First, you need to go to the official website of the service from a computer or other smartphone. Enter your credentials that were used on the locked gadget. After logging in to your personal account, select the device management section.

In the list of available gadgets, find your phone and select the unlock option. The system will send a command to the device, and the lock screen will be removed. If the Internet on the phone is turned off, the command will be executed automatically once the device is in the network coverage area.

⚠️ Warning: Remote unlock only works if the device pre-enabled the "Find Device" option in the Mi Account settings.

It's worth noting that after this procedure, the phone may need to re-enter the Mi Account password the next time it boots, which is part of the Anti-Theft security system that protects the device from theft, and without knowing the password from the account, it will be impossible to use the phone even after the reset.

πŸ“Š Have you ever had a screen lock?
Yeah, I forgot my password.
No, I'm using a print.
Blocked by the virus
Never blocked.

Recovery Mode (Hard Reset)

If you can't access your account, the only option is to force resets, which will return the phone to factory status by completely deleting all user data, including the pattern lock, and then recover the phone.

To enter this mode, 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, while continuing to keep the volume, you will be taken to the main recovery menu.

β˜‘οΈ Reset algorithm via Recovery

Done: 0 / 4

Navigate the menu with volume buttons and select the power button. Find Wipe Data and confirm the selection. Then the system will ask you to confirm the action, often requiring you to enter the word "yes" or select "Confirm." After the process is complete, select Reboot.

Action.Navigation buttonsThe result
Choice of menu itemVolume Up/downMoving the cursor
ConfirmationNutritionExecution of the team
ExitReboot SystemReboot to OS
CancellationReboot to BootloaderEntrance to Fastboot

Once you reboot, the phone will look like a new one, and you'll need to reset the original setup and enter Wi-Fi data. If the phone has Mi Cloud protection enabled, the system will require you to enter the username and password from the account to which the device was associated.

What if the sensor doesn’t work in Recovery?
If the screen does not respond to presses in Recovery mode, try connecting. USB-mouse-over OTG. This will allow you to control the cursor and select the desired menu item for resetting.

Unlocking through USB debugging (ADB)

For advanced users who have had USB debugging enabled in advance, there is a method of deleting the key file through a computer, which allows you to save data, but requires the presence of drivers and tools ADB on the PC.

Connect your smartphone to your computer with a cable. Open the command line on your PC in the ADB tool folder. Enter the command to check the connection: adb devices. If the device is determined, you can proceed to delete the system lock files.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/locksettings.db

Once you have completed the commands, you need to restart the device, and the next time you download, the system will not find the file with the pattern lock and let you go to the desktop, but on newer versions of Android and MIUI, this method is often blocked by security requirements.

⚠️ Attention: On Android 10 and above access to the system folder /data/ for ADB root-free is often closed, which makes this method unworkable on fresh firmware.

If standard commands don't work, you can try to send a command to restart the interface or temporarily disable password checker, but success depends on the particular version of the patch security.

πŸ’‘

Use the original cable to connect to your PC. Cheap cables can only work for charging and not transmit data, leading to a connection error in ADB.

Google's Find My Device Service

An alternative to Xiaomi’s branded service is Google’s standard device search feature. If your phone is logged in to a Google account and geolocation enabled, you can control the lock remotely.

Go to android.com/find from any browser, log in with the same account as the locked phone, and the service will try to locate the device and offer options.

Select the "Clean the Device" option, which will delete all data, including the pattern lock, and return the phone to factory settings, a process similar to Hard Reset, but initiated remotely via an Internet channel.

It is important to understand the difference between locking a screen and locking an account. Google allows you to erase data, but can not always simply remove the password without losing information, unlike some older versions of Android.

πŸ’‘

Remote cleaning through Google accounts works only when an active Internet connection is on a locked device.

Features of unlocking on different versions of MIUI

The procedure for unblocking can vary significantly depending on the MIUI shell version and regional firmware. Chinese (CN) versions often have stricter restrictions and may require unlocking the bootloader even for reset, while global (Global) are more loyal to standard recovery methods.

MIUI 12 and later have enhanced security mechanisms, which can lock the phone for 72 hours or more after a Recovery reset, requiring confirmation of account ownership, to protect against theft when an attacker tries to quickly reset the phone.

  • πŸ“± MIUI 10-11: Often allow unlocking through safe mode or ADB data-free.
  • πŸ”’ MIUI 12-13: Requires mandatory entry of a password from the Mi Account after resetting settings.
  • 🌏 Chinese firmware: Can have hidden menus and differences in the Recovery Mode.
  • πŸ›‘οΈ Android 11-13: Block access to system key files even with root rights in some scenarios.

Users of custom firmware (LineageOS, Pixel Experience) are more fortunate. It often lacks rigid bindings to the Mi Cloud, and the key reset occurs in a standard way without additional checks on the manufacturer's server, but installing such firmware requires an unlocked bootloader.

Prevention of blocking and expert advice

To avoid being in a situation where access to your phone is lost, it is important to follow digital hygiene rules: regularly check if you remember your pattern lock and password from your account. Periodic memory training helps to avoid problems at a critical moment.

Set up alternative unlocking methods. Biometrics (fingerprint, Face) ID) It's convenient, but it doesn't replace the fully digital code. PIN-code or ability to unlock through a smartwatch or Mi Band bracelet.

⚠️ Note: Do not use simple graphic keys (letters "G", "L" or straight lines) as they are easy to guess by fat marks on the screen or by matching method.

Always keep your contacts and important data synced to the cloud on. If you need a full reset, you will only lose your application settings, but you can quickly restore phone books and photos. Backup is the only way to ensure that information is safe.

Can I unlock my phone through the engineering menu?
The engineering menu (#64663##) is designed to test hardware and does not contain password reset functions. Attempting to find hidden commands there often leads to changes in system parameters, which can disrupt the communication modules.
What if the phone requires a password from your Mi Account after a reset?
This is standard anti-theft protection. You need to remember the password from the account to which the phone was attached. If you forget the password, restore it through mi.com using a linked email or phone number, without which you will not officially unlock the device.
Will the phone reset if you enter the wrong key many times?
Yes, after a certain number of failed attempts (usually 5-10), the system will suggest waiting for a while.If you ignore the timers and keep entering incorrect data, the phone may offer a factory reset to protect the owner's data.
Will the phone help you remove the key?
Fastboot flashing completely replaces the system partition, which is essentially a deep reset, but on modern devices with a locked bootloader and Mi Cloud protection enabled, you will still need to log in to your previously used account after the firmware.
Can I remove the pattern lock without losing data?
Without data loss, this is only possible in two cases: if you are debugging over a USB with previously established rights, or if you remember the password. All other methods, including Recovery Mode and remote reset, involve the complete removal of user information.