How to Reset a pattern lock to Xiaomi: Step-by-step instructions

Why Xiaomi Smartphone Is Blocked With a pattern lock and What to Do

A pattern lock on Xiaomi is a convenient way to protect data, but it often causes headaches if the user forgets the combination. According to statistics, one in five smartphone owners has at least once faced a screen unlock problem. PIN-code or password, the pattern lock has no prompts, and the number of attempts to enter is limited - after 5 unsuccessful attempts, the device can lock for 30 seconds or even require you to enter a Mi Account account.

The main reasons for blocking are forgetfulness (especially after a long break in use), accidental change of the key by children or relatives, and failures in the MIUI firmware. It is important to understand that the methods of unlocking depend on the system version, the presence of a tied Mi Account and the status of the developer. For example, on the Xiaomi Redmi Note 10 Pro with MIUI 14, the reset algorithm will differ from the actions on the Poco X3 with MIUI 12.5.

In this article, we will cover all the current methods, from the most secure (via Mi Account) to the radical (hard reset), and also tell you how to minimize data loss. If you are looking for a solution for a particular model, pay attention to the compatibility table at the end of the section.

Method 1: Unlocking with Mi Account (the most secure method)

If your Xiaomi smartphone is tied to your Mi Account and your device has Internet access (mobile network or Wi-Fi), this method will unlock the screen without losing data. The main condition is to remember the username and password from the account. The algorithm works on all devices with MIUI 8 and later, including Redmi 9A, Poco F3 and Xiaomi 12T.

Instructions:

  • πŸ“± On the lock screen, enter the wrong pattern lock 5 times in a row, and a message will appear: "Forgot the pattern lock?" or "Unlock using Mi Account".
  • πŸ”‘ Click on this caption and enter details from your Mi Account (email or phone number) + password).
  • πŸ”„ After successful authorization, the system will offer to create a new pattern lock, PIN-code.

πŸ’‘

If you have two-factor authentication enabled in Mi Account, you will need to enter code from SMS or Google Authenticator app. Make sure you have access to a backup email or phone!

⚠️ Note: If your smartphone is not connected to the Internet, this method will not work, and it is not available if you previously disabled the "Unlock via Mi Account" function in the security settings.

What to do if you don’t remember your Mi Account password?
If you have forgotten your account details, restore access via the official website [account.xiaomi.com](https://account.xiaomi.com). This will require access to an email or phone linked to your account. In extreme cases, you can contact Xiaomi with proof of purchase of the device (check, box with IMEI).

Method 2: Reset the pattern lock via Fastboot (for advanced users)

The Fastboot method is suitable for bootloader devices, requiring a computer, USB Type-C cable and ADB/Fastboot drivers installed. The advantage of the method is to save user data (photos, contacts, messages), but it does not work on all models. For example, on Xiaomi Mi 11 Ultra with MIUI 13, this method may not work due to increased protection.

Step-by-step:

  1. Turn off your smartphone. Press Power + Volume Down buttons for 10 seconds to enter Fastboot Mode.
  2. Connect the device to your PC via USB. Open the command line (Win + R β†’ enter cmd) and check the connection with the command: fastboot devices If the device is determined (the serial number appears), move on.
  3. Enter the command to delete the file with the pattern lock: fastboot erase gesture.key or for new versions of MIUI: fastboot erase locksettings
  4. Reboot your smartphone with the command: fastboot reboot

After the reboot, the pattern lock will be reset, but you will need to set a new way to lock the screen. If the command does not work, try an alternative option:

fastboot erase frp

Install the drivers ADB/Fastboot PC-only|Download the Mi Flash Tool (for Xiaomi)|Unlock bootloader (unlocked)|Prepare original USB-cable

-->

⚠️ Note: On bootloader devices, this method will not work. Check the lock status with fastboot oem device-info. If the answer is Device unlocked: false, you will first need to unlock the bootloader through the official Mi Unlock Tool app.

Method 3: Hard Reset (complete reset)

Hard Reset is an extreme measure that results in complete deletion of data from the device, including photos, apps and settings.The method works on all Xiaomi models, but it is worth using it only if other methods did not help.

Instructions for resetting via Recovery Mode:

  1. Turn off your smartphone. Press Power + Volume for 10-15 seconds until the Mi logo and Recovery menu appear.
  2. Use the volume buttons for navigation and the power button for selection. Select Wipe Data (or Clear Data on newer versions).
  3. Confirm the reset by selecting Wipe All Data β†’ Confirm.
  4. After the process is complete, select Reboot to reboot.

On new devices (such as Xiaomi 13 Pro or Redmi K60), the Recovery menu can be in Chinese.

  • 🧹 β€” data-cleaning;
  • πŸ”„ β€” restart;
  • πŸ“± β€” PC-connection.

Xiaomi modelCombination for entering RecoveryDoes the reset support data loss without data loss
Redmi Note 10/11Power + Volume IncreaseNo.
Poco X3/X4Power + Volume IncreaseNo (except Fastboot)
Xiaomi Mi 11/12Power + Volume IncreasePartially (via Mi Account)
Xiaomi 13 SeriesPower + Volume Increase (hold 20 seconds)No.

⚠️ Attention: On devices with MIUI 14 and later after Hard Reset, you may need to enter data from your previous Mi Account (protection) FRP). If you don't remember your username/password, your smartphone will become a brick.Before resetting, make sure you have a backup and access to your account.

πŸ“Š What Unlocking Method Have You Tried Before?
Mi Account
Fastboot
Hard Reset
I went to the service center.
Never blocked.

Method 4: Use of service codes (hidden MIUI functions)

MIUI has hidden service codes in its firmware that allow you to reset your pattern lock without resetting data, which doesn't work on all devices and software versions, but can be a lifeline if other methods aren't available. For example, on Redmi 8 with MIUI 11, code ##7780## resets security settings, but it's disabled in newer versions.

Current codes for testing:

  • πŸ”’ ##3646633## - Engineering menu (on some models allows you to reset the lock).
  • πŸ”’ ##7780## - Resetting settings (not always working).
  • πŸ”’ ##4636## - Test menu (may contain reset options).

If the code worked, you'll see a menu with a Reset Screen Lock option or similar. On devices with MIUI 13 and later, the service codes for resetting the lock are disabled for security reasons, and instead, you can try an alternative method through ADB (if USB debugging is enabled).

πŸ’‘

Before entering service codes, check if your model supports them. Incorrect use can cause system failure!

Method 5: Unlock via ADB (if USB debugging is enabled)

If your Xiaomi has previously enabled USB debugging (Settings β†’ About Phone β†’ MIUI Version β†’ 7 times press to activate Developer Mode), you can reset the pattern lock via Android Debug Bridge (ADB).

Instructions:

  1. Connect your smartphone to your PC via USB. Open the command line and check the connection: Adb devices
  2. Enter the commands in turn: 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

If the key does not reset after the reboot, try an alternative command:

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

This command will open the new lock screen settings menu bypassing the old pattern lock. The method works on MIUI 10-14, but requires root or unlocked bootloader rights on new devices.

πŸ’‘

USB debugging should be enabled ASAP! If you haven't activated it before locking it, this method won't work.

What to do if nothing helps: contact the service center

If all of these methods do not work, the only option is to contact an authorized Xiaomi service center.

  • πŸ”’ bootloader;
  • πŸ“± shielded FRP (Factory Reset Protection);
  • πŸ”§ damaged firmware after unsuccessful manipulations.

The cost of unlocking the service varies from 500 to 2000 rubles depending on the model and complexity of the work. For example, for Xiaomi 12S Ultra, the price may be higher due to enhanced protection.

  • πŸ“„ prepare a check or a box with IMEI (proof);
  • πŸ”‘ Remember the data from the Mi Account (if linked);
  • πŸ’Ύ Backup important data (if the device reacts in any way).

⚠️ Warning: Don't trust artisanal workshops that offer 10 minutes of undocumented unlocking, which can lead to a loss of warranty or unofficial firmware with viruses.

FAQ: Frequent questions about resetting a pattern lock on Xiaomi

Can I reset the pattern lock without losing data?
Yes, but only if: the device is tied to Mi Account and has access to the Internet; USB debugging (ADB method); the bootloader is unlocked (Fastboot method); In all other cases, the data will be lost.
Why does Hard Reset ask for an old Mi Account?
This is FRP (Factory Reset Protection) protection, which is activated if a Mi Account was attached to the device. To circumvent it, you need to enter data from the previous account or provide proof of purchase at the service center.
Does resetting via service codes work on MIUI 14?
No, in the latest versions of MIUI (13+), the service codes for resetting the lock are disabled for security reasons.
Can I unlock Xiaomi through Find My Device?
No, Google's Find My Device feature on Xiaomi allows you to only lock your device or erase data remotely, but not reset the pattern lock.
How much does it cost to unlock in the Xiaomi service center?
The cost depends on the model and the region: Redmi Note / Poco: 500-1000 rubles; Xiaomi 11/12/13 series: 1000-2000 rubles; Devices with damaged firmware: from 2500 rubles.