How to remove the pattern lock on Xiaomi: the complete guide

A situation where the smartphone owner forgets the pattern lock or PIN-Code is one of the most common problems in the Android ecosystem, and on Xiaomi, Redmi and Poco devices, this problem is solved in several ways, but the choice of method depends on whether the Mi Account was linked to the device and whether debugging was enabled. USB. Modern versions of the shell MIUI HyperOS and HyperOS have significantly increased security measures, so old methods like entering code through adb without permission may not work.

In this guide, we will look at the current algorithms that will help unlock the device in 2026. It is important to understand that some methods involve a complete memory cleanup, so you need to approach the process with awareness. If you did not back up, data may be lost irretrievably, but access to the phone will return.

Before taking drastic measures, it’s worth checking whether the phone is temporarily locked because of multiple failed typing attempts. Sometimes the system itself offers to wait a certain time or log in through a Google account. However, in the case of Xiaomi, the most common intervention is through the recovery menu or the manufacturer’s cloud services.

Resetting through Mi Account: the most gentle method

The most civilized way to save personal data is to use Xiaomi’s Find Device feature, which will only work if the locked phone has logged in to a Mi Account, turned on the Internet (Wi-Fi or mobile data), and activated the device search function, and if these conditions are met, you can remotely change the lock code of the screen.

To start, you need to go to the official website of the Mi Cloud service from any other device, whether it is a computer or another smartphone. In the login field, enter your account information. After successfully logging in to your personal account, find the Device or Find Device section. In the list of available gadgets, select the one you want to unlock.

Once you select the device, you'll see a map with its location (if GPS is on) and a control panel. You're interested in the Unlock or Unlock button. When you click on it, the system will require you to confirm your account password. Once confirmed, the pattern lock on the phone will be reset, and you can specify a new one or use the device without a password.

⚠️ Note: After remotely unlocking via Mi Cloud, the phone may require re-entering the account password the next time it is turned on for security reasons.

If the Internet is not available on a locked phone, this method will not work, but sometimes it helps to turn on the flight mode or reboot the router so that the device tries to sync, and it is worth considering that the feature does not work on all versions of firmware equally stable.

Recovery Mode (Hard Reset)

When you can’t access your account or you can’t access the internet, Hard Reset is the only working option, which returns your smartphone to factory settings by completely erasing user data, including photos, contacts and apps. Make sure you have at least 30-40% battery power before starting the procedure.

To enter the recovery menu on the device turned off, you need to press the button combination. On most Xiaomi models, this is the simultaneous pressing of the Volume Up button and the Power button, hold them until the Mi logo appears, after which the power button can be released, continuing to hold the volume.

☑️ Preparation for Hard Reset

Done: 0 / 4

In the menu that opens, you can navigate with volume buttons (up/down), and the choice is confirmed by the power button. You need to find the Wipe Data item and select it. Next, the Wipe All Data subitem, the system will request confirmation - select Confirm.

The cleaning process can take anywhere from a few seconds to a couple of minutes. Once completed, the Data wiped successfully message will appear on the screen. Press Back to Main Menu, then select Reboot → Reboot to System. The phone will restart, and the initial setup will begin, as when you first turn on.

Importantly, once reset, the device can request a password from a previously linked Google account or Mi Account, which is FRP (Factory Reset Protection) protection that prevents stolen phones from being used, and without knowing these passwords, unlocking the device will be extremely difficult.

Use of debugging by USB and ADB

For advanced users who have pre-installed USB Debugging in the developer menu, it is possible to delete the key file via a computer.This method does not require data reset, but only works on older versions of Android (typically before version 10-11) and requires installing drivers and ADB utility on a PC.

First, connect your smartphone to your computer via the original cable. Open the command line or terminal in the folder with ADB installed. Enter the command to check the connection: adb devices. If the phone screen appears a window requesting debugging permission, it must be confirmed (which is impossible with a locked screen, unless previously there was a checkbox “always allow”).

If the connection is established, you can try to delete the file that stores the pattern lock. Enter the following command in the terminal:

adb shell rm /data/system/gesture.key

Alternatively, for some versions:

adb shell rm /data/system/locksettings.db

Once you have completed the command, restart the device. If the operation is successful, the phone must start without asking for a password, or any arbitrary key can be entered. However, on modern versions of MIUI with data encryption, this method is often useless, since access to system files without unlocking is closed.

Why can't ADB work?
Modern versions of Android use encryption of user data. Without a password or fingerprint, the /data partition is not read and written even through ADB, unless the device was previously authorized on this PC with the "always allow" flag.

Unlocking through Mi Unlock service

The official Mi Unlock Tool is primarily designed to unlock the bootloader, but its use indirectly helps in situations where you need to reflash the device to reset the password.

The process is as follows: download the Mi Unlock utility from the official website, install it on your PC. Put your phone in Fastboot mode (clamping the Volume Down + Power buttons). Connect the cable and press Unlock in the program.

The main limitation is the temporary lock, which means that once you have an account linked to your device, you have to wait 7 to 168 hours (usually 168 hours, that is, 7 days) before unlocking becomes possible.

ParameterDescriptionRisk of data loss
Mi Cloud (Find Device)Remote reset via siteNo (data retained)
Recovery ModeReset buttons on the phone turned offYes (total removal)
ADB CommandDelete the key file via PCNo (only for older Androids)
Mi Unlock ToolUnlocking the loaderYes (total removal)

What to do if your phone requires a Google account (FRP)

After a hard reset, many users are faced with an activation screen where the device requires you to enter a password from a Google account that was previously synchronized, which is FRP (Factory Reset Protection), and if you remember the username and password, there are no problems, just type them in.

If the data is lost or the phone is bought with hands, the situation becomes complicated. FRP on modern versions of Android and MIUI It gets more complicated with every security update. There are methods through TalkBack, special security updates. APK-files or engineer mode, but they require high qualifications and are often closed by the manufacturer.

💡

Try to restore your Google account through your computer. Go to Google, select Forgot Password, and follow the instructions. This is the most legal and reliable way.

Some service centers offer FRP removal services for a fee using paid programmers and accounts. Self-attempts to “break through” security through vulnerabilities found on the Internet can lead to a complete locking of the device (the “brick”) if a flawed version of the software is stitched.

It is also worth mentioning that some Xiaomi models with MediaTek processors have the option of resetting FRP through special utilities (such as MTK Client), but this requires disassembling the phone and closing contacts to enter BROM mode, which is not recommended for beginners.

📊 Have you ever had a screen lock on Xiaomi?
Forgot my password, reset my Mi Account.
Did Hard Reset, lost data
Got into FRP (Google account)
Never blocked your phone.

Prevention and setting up of smart unlocking

To avoid such problems in the future, it is recommended to configure alternative ways of access. In the Settings menu → Passwords and security → Unlock the screen, you can add a fingerprint, facial recognition or Smart Lock.

Smart Lock allows you to keep your phone unlocked in certain conditions, whether it’s in your pocket (On-body detection), next to a trusted Bluetooth device (smart watch, headphones) or in a safe place (home, work), which makes life much easier, although it reduces security slightly.

Also, remember to back up your data regularly in Mi Cloud or Google Drive. Setup automatic synchronization of contacts, photos and notes will take a couple of minutes, but save you from losing important information if you need to reset.

💡

Regularly synchronizing data and adding multiple unlocking methods (face, finger, password) is the best insurance against losing access to the device.

Also, write down your pattern lock or PIN-The code is in a safe place (notebook, password manager). Human memory is imperfect, and complex combinations designed to protect data are often forgotten by their owners.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without losing data?
Without data loss, you can only unlock your phone through the official Mi Cloud website (Find your device feature) if you have internet and an account attached to your phone. All other methods, including Hard Reset and Mi Unlock, result in complete deletion of information.
What to do if I forget my Mi Account password?
You need to restore access to your account through i.mi.com using a linked phone number or backup email, and without access to your Mi Account or Google account, unlocking your device after a reset will be extremely difficult.
Will the phone reset if you enter the wrong key 10 times?
Usually after 5-10 wrong attempts, the phone is temporarily locked for 30 seconds, 5 minutes or an hour.The automatic data reset function after a certain number of errors must be enabled by the user in advance in the security settings.
Will Fastboot help you remove your password?
Yes, a full flashing of the device via Fastboot (Clean All) mode will delete the password, but it will also destroy all data on the phone.