How to unlock Xiaomi if you forget the pattern lock: step-by-step instructions for MIUI

The forgotten pattern lock on Xiaomi is a situation that thousands of users face every day, and it's especially problematic when it comes to a loved one's phone, whether it's a husband, wife or child. PIN-In this article, we will discuss 5 proven ways to restore access to Xiaomi (including Redmi models) and the graphical password has no prompts, and repeated unsuccessful attempts to enter lead to complete locking of the device, POCO Black Shark, which is relevant to the firmware MIUI 12-14 (2026).

It is important to understand that there is no one-size-fits-all method, and that the choice of solution depends on the version of MIUI, the phone model, the backup, and even whether the Mi Account is tied. We will look at both legal (using official Xiaomi tools) and technical methods (for example, through ADB or Fastboot), but we will warn you in advance that some of them will lead to data loss.

If you’re looking for a way to bypass the lock secretly, we’re warning you that modern versions of MIUI are protected from such manipulations, and all of the methods described below require either the consent of the phone owner or proof of your right to the device (e.g., a purchase check).

Recovery through Mi Account (official method)

The easiest and safest way to unlock Xiaomi is to use a tied Mi Account, which works if:

  • πŸ“± The phone is connected to the Internet (Wi-Fi or mobile network).
  • πŸ”‘ The device previously had a Xiaomi account login (even if you don’t remember the password now).
  • πŸ”„ Find Device is activated in the settings.

If these conditions are met, follow the instructions:

  1. Go to account.xiaomi.com from a computer or other phone.
  2. Sign in with the same account as on the locked device.
  3. In the Devices section, find the locked phone and select Find Device.
  4. Click Unlock and confirm the action via SMS or email.

After that, the phone unlocks automatically and the pattern lock resets, and it's important that if the device has two-factor authentication enabled, you need to enter code from SMS or Google Authenticator.

⚠️ Warning: If the phone is not connected to the Internet, this method will not work, and it is not available if the owner has previously untied the Mi Account or reset the phone to factory settings.

πŸ“Š How often do you use your Mi Account?
Constantly.
Only when setting up the phone
Never used it.
Forgot my password.

2. Reset the pattern lock through Recovery mode

If your Mi Account is not tied or you don’t remember the login details, the next step is to reset hardware via Recovery Mode, which will remove all data from your phone, including photos, contacts and apps, but will return access to the device.

The manual is suitable for most Xiaomi, Redmi and POCO models (except for devices with a locked Bootloader).Be sure to charge at least 30% before you start.

β˜‘οΈ Preparing for resetting through Recovery

Done: 0 / 4

Step-by-step:

  1. Turn off the phone with a long press on the power button.
  2. Press the button combination: For most models: Volume up + Power. For POCO F1/F2/F3: Volume down + Power. For Black Shark: Volume up + Volume down + Power.

Mi

Recovery

Wipe Data

Factory Reset

Yes

Reboot

The phone will reboot in a factory state. During the setup phase, you will need to enter the data of the Google account that was previously associated with the device (FRP - Factory Reset Protection).

Xiaomi modelCombination for RecoverySupport for FRP
Redmi Note 10/11/12Volume up + NutritionYes (on MIUI 12+)
POCO X3/X4/X5Volume up + NutritionYes.
Mi 11/12/13Volume up + NutritionYes (requires confirmation via Mi Account)
Black Shark 4/5Volume up + Volume down + NutritionYes.

⚠️ Note: On devices with Bootloader blocked (for example, official firmware for Russia), a reset via Recovery may require you to enter your Mi Account data, even if you do not remember the pattern lock.

3. Use of ADB (to unlock without loss of data)

If the phone is debugging on USB (USB Debugging, there is a chance to delete the pattern lock without resetting data through ADB (This method only works if two conditions are met:

  • πŸ”Œ Debugging by USB was activated prior to blocking.
  • πŸ’» You have access to a computer with Xiaomi drivers and tools installed ADB.

Instructions:

  1. Connect your phone to your computer via the original USB Type-C cable.
  2. Open the command prompt (CMD) or Terminal (on macOS/Linux).
  3. Enter the command to check the connection: adb devices If the phone appears in the list, go further.
  4. Delete the file with the pattern lock: adb shell rm /data/system/gesture.key or (for newer versions of MIUI): adb shell rm /data/system/locksettings.db
  5. Reboot your phone: adb reboot

Once rebooted, the pattern lock will reset, but all data (photos, messages, apps) will remain in place, which only works on phones with Bootloader unlocked or custom firmware, and on official MIUI 13+ firmware, it may not work due to enhanced security.

πŸ’‘

If the adb device team does not find the device, try reinstalling Xiaomi drivers via the official website or using the Mi PC Suite program.

4 Unlocking via Fastboot (for power users)

If USB debugging is disabled but you have access to Fastboot mode, you can try resetting the pattern lock via the modified recovery firmware.This method requires an unlocked Bootloader and is only suitable for users with Xiaomi experience.

Step-by-step:

  1. Turn off the phone and press Volume Down + Power to log into Fastboot Mode.
  2. Connect your phone to your computer and check the connection with the command: fastboot devices
  3. Download custom recovery (such as TWRP) for your model from twrp.me.
  4. Fastboot flash recovery twrp.img (replace twrp.img with the name of the downloaded file).
  5. TWRP: Fastboot Reboot Recovery
  6. In TWRP, go to Advanced β†’ File Manager and delete files: /data/system/gesture.key /data/system/locksettings.db /data/system/locksettings.db-wal /data/system/locksettings.db-shm

Reboot the phone.

This method saves data, but requires unlocked Bootloader. on official firmware Xiaomi for Russia unlocking the bootloader takes up to 720 hours (30 days) of waiting.

What to do if Bootloader is blocked?
If Bootloader is blocked, you can unlock it only through the official Mi Unlock Tool. This requires: 1. Link your Mi Account to your phone. 2. Enable the option "OEM Unlock in the developer settings. 3. Wait 7-30 days (depending on the model) before unlocking. TWRP and remove the pattern lock.

5. Alternative methods: contacting the service center

If all of these methods fail, there are two options:

  1. Official service center Xiaomi – you will need to present a check or a warranty card confirming ownership. Reset pattern lock in the service costs from 1000 to 3 000 rubles (depending on the model).
  2. Unofficial workshops – many offer unlocking services through EDL Mode (emergency firmware mode), but this is risky: you can lose the IMEI or get a β€œbrick”.

Xiaomi’s official service centers do not work with phones without proof of purchase.

Why does the phone not turn on after reset via Fastboot?
This can happen for three reasons: Incorrectly stitched recovery (for example, an incompatible version of TWRP); interrupted firmware (for example, disabling a USB cable); blocked Bootloader on official firmware; Solution: try flashing the original recovery through Fastboot with a command: fastboot flash recovery recovery.img or contact the service center.