Forgetting the pattern lock on a Xiaomi smartphone is a difficult but solvable situation. The main thing is not to panic and not try to find a combination at random: after 5 wrong attempts, the device will lock for 30 seconds, and after 20 - may require entering a password from Mi Account or completely reset to factory settings. In this article, we will analyze all the current methods of unlocking, including official methods from Xiaomi and technical workarounds for experienced users.
It's important to understand that the choice of method depends on whether your smartphone is tied to a Mi Account, whether USB debugging is enabled, and whether you are ready to lose data. For example, if you have never logged in to Mi Account or disabled synchronization, some methods will not be available. We have arranged instructions from the most secure (save data) to the radical (full reset) so that you can choose the best option.
Note: All methods have been tested on Xiaomi 2018-2026 models (including the Redmi Note, POCO, Mi and Black Shark series).If your device is older, additional actions may be required β these are also mentioned.
1 Unlocking through Mi Account (official method)
The easiest and safest method is to use a linked Mi Account. It works if:
- π Smartphone connected to the Internet (Wi-Fi or mobile data).
- π± You have previously logged in to Mi Account on this device.
- π Remember your account password (or you can restore it through your account) email/SMS).
After 5 failed attempts to enter the pattern lock, the button βForgot the passwordβ or βUnlockβ via Mi Account will appear on the screen.
- Enter the email or phone number associated with the Mi Account.
- Confirm your identity through SMS-code.
- Create a new pattern lock or PIN-code.
If there is no Unblock button via Mi Account, try connecting to another Wi-Fi network (sometimes the lock is triggered due to lack of Internet), and check if sync with the account in the settings is disabled - this could happen after resetting or updating the firmware.
π‘
If you donβt remember the password from Mi Account, restore it to the official account.xiaomi.com. Use a backup email or a linked phone number.
2. Reset the pattern lock via Find Device (remotely)
If your smartphone is connected to the Internet but you donβt have an unlock button on your Mi Account, try remote password reset via Find Device, which works even if the device isnβt in your hands (for example, lost or stolen).
Instructions:
- Go to i.mi.com and log in to your Mi Account.
- Select the locked device in the list (if there are several).
- Click Delete Data β Erase the device.
- Confirm the action. SMS-code.
After that, the smartphone will reboot and reset to factory settings, all data (photos, contacts, messages) will be deleted, but the lock of the pattern lock will be removed, this method is suitable if the device does not have important information or it is synchronized with the cloud.
π‘
Resetting via Find Device only works when you have an active internet connection on your smartphone. If Wi-Fi or mobile data is disabled, the method won't work.
3. Unlock through ADB (for power users)
If you have USB debugging enabled on your smartphone (Settings β About Phone β MIUI version, press 7 times to activate developer mode), you can delete the pattern lock through ADB without losing data. This method requires a computer and basic command line knowledge.
Step-by-step:
- Connect your smartphone to your PC through USB-cable (original or quality).
- Open the command line (Windows) or terminal (macOS/Linux) in the adb folder.
- Enter the commands in order: adb shell su rm /data/system/gesture.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot
- After rebooting, the pattern lock will be reset.
If the su command doesn't work, then there are no root rights on the device, in which case, try an alternative method:
adb shell am start -n com.android.settings/.ChooseLockGenericWhat if the ADB canβt see the device?
4 Unlocking via Fastboot (with data loss)
If USB debugging is disabled but the bootloader is unlocked (or you are ready to unlock it), you can reset the pattern lock via Fastboot mode, which will result in data loss but will keep the device running.
You'll need:
- π₯οΈ Computer with installed ADB and Fastboot.
- π Original. USB-cable.
- π± Unlocked bootloader (if not, you will need to unlock through the Mi Unlock Tool).
Instructions:
- Turn off your smartphone.
- Press the Power button + Volume down to log into the Fastboot.
- Connect the device to the PC and execute the command: fastboot erase userdata
- Upon completion, type in fastboot reboot
The smartphone will reboot and offer to configure it as new, a method suitable for devices with a locked bootloader, but requires pre-unlocking through the official Mi Unlock Tool (the process takes up to 72 hours of waiting).
βοΈ Preparing for Unlocking via Fastboot
5 Hard Reset β Last Chance
If no other method has worked, it will be hard to reset through Recovery, which will delete all data on the device, including photos, messages and apps, but will return access to the smartphone.
Instructions for most Xiaomi models:
- Turn off the device.
- Press the Power button + Volume up until the Mi logo appears.
- From the Recovery menu, select Wipe Data β Wipe All Data.
- Confirm the action and wait for the process to be completed.
- Select Reboot to reboot.
On some devices (e.g. POCO F1 or Mi A2), the Recovery menu may be different. If the standard method doesn't work, try:
- π Clutch power. + Loudness up + Loudness down at the same time.
- π§ Choose the menu Advanced β Wipe Dalvik Cache before resetting.
π‘
After a hard reset, the smartphone can request data from the previous Mi Account if the Device Protection function was enabled, in which case you will need to enter a login and password from the account that was associated before the reset.
Frequent Mistakes and How to Avoid Them
When you unlock Xiaomi, users often face typical problems, and we have collected the most common ways to solve them:
| Mistake. | Reason. | Decision |
|---|---|---|
| ADB does not see the device | There are no drivers or debugging is not included | Install Mi PC Suite or drivers manually through Device Manager |
| "This device is locked" on Fastboot | bootloader locked | Unlock the Mi Unlock Tool (requires a wait of 72β168 hours) |
| After reset, asks for an old Mi Account | Device protection activated | Enter your previous account or contact Xiaomi for support |
| The button "Unlock through Mi Account" does not work. | No Internet or account is not linked | Connect to Wi-Fi or use a different method |
If you encounter an error not described in the table, check:
- π Battery level (should be) >20%, otherwise the discharge may be interrupted).
- π Quality. USB-cables (damaged wires often cause errors) ADB).
- π± The firmware version (on older versions) MIUI New teams may not work).
π‘
If your smartphone is running an E:unknown command error in Recovery, you have Custom Recovery (TWRP), in which case, select Wipe β Format Data and type in yes to confirm it.
How to protect yourself from repeated blocking
To avoid the problem of a forgotten pattern lock in the future, follow the following simple rules:
- π Use it. PIN-code instead of a pattern lock, it is more difficult to forget.
- π§ Link Mi Account and update your backup email regularly.
- π Enable automatic contact synchronization and photos with Mi Cloud.
- πΎ Create a local backup through Settings β Additionally. β Backup.
- π§ Activate debugging on USB (in case of unlocking through ADB).
We also recommend that you write down a pattern lock or PIN-code in a safe place (such as in a password manager or on paper) Avoid obvious combinations like the letter "Z" or simple geometric shapes, which are easy to pick up by third parties.
π‘
On Xiaomi models with an infrared port (for example, Redmi Note 8 Pro), you can use the remote control to unlock through Mi Remote.
FAQ: Answers to Frequent Questions
Can you unlock Xiaomi without losing data if USB debugging is disabled?
The smartphone asks for the Mi Account password after the reset. What if I can't remember it?
Does unlocking through ADB on Xiaomi work with a locked bootloader?
How to unlock Xiaomi if you forgot the pattern lock and turned off Mi Account?
Can I unlock Xiaomi through a service center without a check?
If none of these methods worked, contact Xiaomi with a device model, serial number (you can find it on the box or under the battery), and a description of the problem. In some cases, they may provide individual instructions.