How to Unlock Xiaomi If You Forgot Your pattern lock: 2026 Step-by-step Guide

The forgotten pattern lock on Xiaomi's smartphone is a situation that thousands of users face every day. PIN-If you have a code or a password, a graphic pattern seems easy to remember, but its abstract nature is often a cruel joke. MIUI locks the device for 30 seconds, and after 20 failed attempts may require you to enter a Mi Account account - which may also be forgotten.

In this article, we will discuss 5 working methods for bypassing the pattern lock on Xiaomi, Redmi, POCO and Black Shark devices (relevant to MIUI 12-15 firmware). Importantly, not all methods will save your data - some lead to a complete reset. We will specify the risks in advance so you can choose the best option. You will also learn how to avoid blocking in the future and what to do if the smartphone requires confirmation through Mi Account, which is not accessible.

1 Unlocking through Mi Account (official method)

The safest and most recommended way for Xiaomi is to use a tied Mi Account, which works if:

  • πŸ“± Device connected to the Internet (Wi-Fi or mobile network).
  • πŸ”‘ You remember the login (email/phone number) and password from Mi Account.
  • πŸ”„ Find Device has been activated in the settings.

After 5 failed attempts to enter the pattern lock, the system will offer the option "Forgot the password?". Click on it and follow the instructions:

  1. Enter the email or phone attached to your Mi Account.
  2. Confirm the identity via SMS or email (the code will come to the mail / phone).
  3. Create a new pattern lock or PIN-code.

⚠️ Note: If you have previously disabled the Find Device service (Settings) β†’ Mi Account β†’ Finding the device won’t work, and Xiaomi may also request additional verification (such as a linked phone number) if the account was created long ago.

πŸ“Š You remember the data from your Mi Account?
Yeah, login and password.
I remember the login, but I forgot the password.
I don't remember anything.
I don't have a Mi Account.

2. Recovery Mode reset (data loss)

If Mi Account is lost and unlocked, hard reset is reset via Recovery Mode, which deletes all data on the device, including photos, messages and apps, but is guaranteed to unlock the smartphone.

Instructions for most Xiaomi models (including Redmi Note 10/11/12, POCO X3/X4, Mi 11/12):

Turn off your smartphone (press the power button for 10 seconds)

Connect the charger (the battery must be charged at least 30%)

Make sure you have a backup of important data (if it was created earlier)

-->

  1. Turn off the device (if it is locked, press the power button for 10-15 seconds).
  2. Press the button combination: For most models: Volume up + Power button. For older devices (until 2019): Volume up + Volume down + Power button.

Mi

Recovery Mode

Wipe Data

Clear Data

Wipe All Data

Reboot

⚠️ Note: On some devices with MIUI 14+ Mi Account data may be required after reset if Factory Reset Protection has been activated previously (FRP). This is a protection against theft, and it is almost impossible to get around it without access to an account.

What is FRP and why does it lock the device after a reset?
FRP (Factory Reset Protection) is a factory-fabricated reset protection system introduced by Google in Android 5.1. If a Google or Mi Account account was attached to a device, after resetting through Recovery, the system will require that account information to be entered, which makes it difficult to use stolen smartphones, but also creates problems for legitimate owners who have forgotten account details.

3. Use of ADB (for advanced users)

If your Xiaomi has enabled debugging on USB (USB Debugging, you can try to delete the file with the pattern lock through ADB (Android Debug Bridge: This method does not result in data loss, but requires prior preparation.

Conditions for this method:

  • πŸ”Œ On the smartphone was activated debugging on USB (Settings β†’ The phone. β†’ Version. MIUI (7 times press) β†’ Developer settings β†’ Debugging by USB).
  • πŸ’» You have a computer with Xiaomi drivers installed and a tool ADB.
  • πŸ”— The device can connect to the PC through USB (even in a blocked state).

Instructions:

  1. Connect your smartphone to your computer via USB.
  2. Open the command line (Windows) or terminal (macOS/Linux) and type:
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 the reboot, the pattern lock will be reset. If the commands don't work, try the alternative:

adb shell am start -n com.android.settings/.ChooseLockGeneric

⚠️ Attention: On devices with MIUI 13+ Android 12+ This method may not work due to the increased protection of the system, and some Xiaomi models are blocked. ADB-commands with a locked screen.

4. bypassing Fastboot (for unlocked bootloader)

If your device has a Bootloader Unlocked, you can use the fastboot command to reset the pattern lock, a method that is suitable for users who have previously unlocked the bootloader to install custom firmware.

Step-by-step:

  1. Turn off your smartphone and put it in Fastboot mode (clip Volume Down + Power button).
  2. Connect the device to the PC and open the terminal.
  3. Enter a command to check the connection:
fastboot devices
  1. If the device is detected, execute the command to remove the key:
fastboot erase userdata

or (for some models):

fastboot format userdata

⚠️ Warning: This command deletes all user data but saves system files. If the bootloader is locked, the method will not work - you will need official unlock through the Mi Unlock Tool, which takes up to 720 hours (30 days) of waiting.

πŸ’‘

Before unlocking the bootloader, back up your data via TWRP (if installed), a method that allows you to save some of the information even after you reset.

5. Alternative methods (with limitations)

If none of the above methods are suitable, alternatives can be tried, and their effectiveness depends on the device model and the MIUI version.

MethodConditionsRisks.Efficiency
Calling a blocked phoneThe device is on call reception, there is a second phone.Not working on MIUI 14+Low (10%)
Use of emergency call modeAccess to the Emergency Call screenIt can only work on older versions of AndroidAverage (30%)
Installation of custom Recovery (TWRP)Unlocked bootloader, experience with firmwareRisk of "bricking" of the deviceHigh (80%)
Feedback with Xiaomi (proof of ownership)Availability of a check, box, IMEI deviceLong process (up to 2 weeks)High (90%)

One of the most exotic methods is to call a locked phone, and on some devices (such as the Redmi 4X or Mi A1), you could access the interface and disable the lock during the incoming call, but in MIUI 12+, this vulnerability is fixed.

A more reliable, but complicated, way is to install TWRP, which allows you to back up data before you reset it, or even delete a file with a pattern lock manually, but it requires an unlocked bootloader and firmware experience.

πŸ’‘

If you are not sure about your ADB or Fastboot skills, it is best to contact the service center.The wrong commands can lead to a complete loss of the device's performance.

6.How to avoid blocking in the future

To avoid the problem of a forgotten pattern lock again, follow these tips:

  • πŸ” Use it. PIN-A code or password instead of a pattern lock – it’s easier to recover them with a Mi Account.
  • πŸ“ Write the key in a secure location (e.g., Google Password Manager or Bitwarden).
  • πŸ”„ Regularly back up through Settings β†’ System system β†’ Backup.
  • πŸ“± Attach to your Mi Account device and activate Find the Device.
  • πŸ”§ Put the debugging on. USB In case of future problems (but do not leave it on permanently for security reasons).

We also recommend setting up a Smart Lock in Android that will automatically unlock the device in secure places (such as at home or at work). To do this, go to Settings β†’ Screen Lock β†’ Smart Lock and add trusted devices or locations.

If you often forget passwords, consider using biometric unlocking (fingerprint or facial recognition). On Xiaomi devices with MIUI 13+, these methods work stably and can serve as a backup option.

FAQ: Frequent questions about unlocking Xiaomi

Can I bypass a pattern lock without losing data?
Yes, but only if the device has been enabled to debug over USB and you can use ADB. Otherwise, all methods other than unlocking through Mi Account will result in the deletion of data.
What to do if you forget your Mi Account information?
Restor access via account.xiaomi.com. If your phone number is tied, request an SMS with a recovery code. If nothing helps, contact Xiaomi with proof of ownership of the device (check, IMEI).
Why does Recovery ask for an old Mi Account?
This is FRP (Factory Reset Protection) protection, and if you don't remember your account information, you can't unlock your device yourself, you'll need to contact a service center with documents on your smartphone.
Can I unlock Xiaomi with service codes (##)?
No, service codes (e.g. ##7780##) do not work to reset the pattern lock on modern Xiaomi devices.
How much does it cost to unlock in the service center?
The cost depends on the model and the region. On average, unlocking without proof of ownership costs 1500-3000 rubles, with proof (check, passport) - 500-1000 rubles. Official Xiaomi service centers can do this for free upon presentation of the purchase document.