How to Reset a pattern lock on Xiaomi: A Step-by-Step Guide

Forgot the pattern lock on Xiaomi and can't unlock the phone? This problem is familiar to many users, especially if the device has been unused for a long time or the password was entered automatically. PIN-In the case of a code or fingerprint, a pattern lock is more difficult to recover from memory – it is easy to forget, but difficult to pick up by brute force.

In this article, we will look at all the current ways to reset the pattern lock on Xiaomi, Redmi and POCO smartphones, from official methods with minimal data loss to radical solutions like hard reset. It is important to understand that not all options will suit your model: for example, on new devices with MIUI 14+ and Android 13+, some loopholes are closed. We will indicate which methods work on modern firmware and which only on old ones.

Before you start, check:

βœ… Do you have a backup of your data (e.g., in Mi Cloud or on your computer)?

βœ… Is your phone connected to your Mi Account?

βœ… Is there access? SIM-card SD-map installed in the device?

The answers to these questions will help you choose the best way to unlock.

1 Unlocking through Mi Account (official method)

The most secure and recommended method for Xiaomi is to use a tied Mi Account, which works on most models if:

  • πŸ“± The phone is connected to the Internet (Wi-Fi or mobile data).
  • πŸ”‘ Mi Account was activated on the device before blocking.
  • πŸ”„ On the lock screen there is a button "Forgot your password?" (on some firmware it is not available!).

If these conditions are met, follow the instructions:

  1. On the lock screen, tap on "Forgot Password?" (or "Forgot pattern?" on English firmware).
  2. Enter the email or phone number associated with the Mi Account.
  3. Confirm the login via SMS or email (the code will come to the linked number / mail).
  4. Create a new pattern lock or PIN-code.

Important: If you don't have a "forgot password?" button, it means your model has disabled it, and it won't work if you:

  • 🚫 The device is not connected to the network (no Internet connection).
  • 🚫 Mi Account is not tied in advance.
  • 🚫 The phone was bought from hand and the previous owner did not untie the account.
πŸ“Š Your Xiaomi is tied to your Mi Account?
Yes, he is.
No, not tied.
I remember.
I use a local account.

2. Reset the pattern lock via Recovery Mode (without loss of data)

If Mi Account doesn’t work, you can try resetting the key through Recovery, which works for many Xiaomi models. MIUI 10–13, but requires the presence of SD-card OTG-flash-cable.

Instructions:

  1. Turn off the phone with a long press of the power button.
  2. Press Volume Up + Power before the Mi logo appears (this is the launch of Recovery Mode).
  3. Select the language from the recovery menu (if there is one).
  4. Go to Advanced β†’ File Manager (on some firmware, the path may be different).
  5. Find the file /data/system/gesture.key (or password.key) and delete it.
  6. Reboot the phone.

What happens? Once you delete the gesture.key file, the system can't check the pattern lock, and the phone unlocks, but this method doesn't work on all models: on new File-Based Encryption devices, the file may be missing or protected.

Insert SD-map OTG-flash-drive|Download gesture.key file (if you need a replacement)|Check the battery charge (minimum 30%)|Make sure the model supports File Manager in Recovery-->

3. Hard Reset (full reset)

If the previous methods didn't work, the radical solution is a complete reset to factory settings (Hard Reset), which will remove all data from your phone, including photos, contacts and apps. Use it only as a last resort!

How to make Hard Reset on Xiaomi:

  1. Turn off the phone.
  2. Press Volume Up + Power before the Recovery menu appears.
  3. Select Wipe Data β†’ Wipe All Data (navigation with volume buttons, confirmation – power button).
  4. Confirm the action (it may be necessary to enter a password from Mi Account if the phone is tied!).
  5. After reset, select Reboot β†’ Reboot to System.

⚠️

Note: On devices with MIUI 12+ and Mi Account tied, Hard Reset may require login and password from your account. If you don’t remember them, the phone will turn into a brick, which will be extremely difficult to unlock!

What to do if you need a Mi Account after Hard Reset?
If the phone asks for data from Mi Account after the reset, and you do not remember them, there are two options: 1. Restore access to the account through [the official website of Xiaomi](https://account.xiaomi.com/) (access to email/phone). 2. Contact the service center with proof of purchase (check, box) - they can unlock the device through special tools.

4. Unlock through ADB (for advanced users)

If the phone is debugging on USB (USB Debugging, you can try resetting the pattern lock through ADB (Android Debug Bridge is suitable for users who have previously activated the developer mode.

Instructions:

  1. Connect your phone to your computer through USB-cable.
  2. Open the command line (Windows) or terminal (macOS/Linux) and type in: adb shell su rm /data/system/gesture.key reboot
  3. If the su command doesn’t work, then there are no root rights – try an alternative method: adb shell am start. -n com.android.settings/.ChooseLockGeneric adb shell input text 1234 adb shell input keyevent 66 (It mimics input. PIN-code 1234 β€” if it has been established earlier).

⚠️

Note: ADB only works if USB debugging was enabled before locking. New Xiaomi firmware may require additional confirmation on the phone screen, which is not possible with a locked device.

5. Use of service codes (for older models)

Some older Xiaomi models (e.g. Redmi 3S, Redmi Note 4) can reset the pattern lock through service codes, which does not work on all devices and may depend on the firmware version.

Try the following combinations:

  • πŸ“ž ##7780## - Resetting settings (user data is saved).
  • πŸ“ž *2767*3855# β€” Resetting everything (including internal memory!).
  • πŸ“ž ##3646633## - Entrance to the engineering menu (on some firmware allows you to reset the lock).

Warning: Service codes can lead to irreversible consequences, including loss of IMEI or damage to firmware.

πŸ’‘

If the service codes don't work, try dialing them in the Phone app, and some firmwares block the codes and instead send a message saying "This code is not supported."

6. Contact the Xiaomi Service Center

If none of these methods worked, you have to contact the official service center Xiaomi.

  • πŸ“„ Check or warranty card (proof of purchase).
  • πŸ“± Phone box (in some models, the serial number on the box must match the IMEI device).
  • πŸ”‘ Passport (for proof of identity).

The service center can unlock the phone through special software, but this will take from a few days to a week, the cost of the service varies from 500 to 2000 rubles depending on the model and the complexity of the lock.

⚠️

Warning: Don't go to informal workshops promising "quick unlock" for a low price, and you're at risk of getting a phone with damaged firmware or stolen data (if the wizard copies your internal memory).

Comparison of Unlocking Methods

MethodConditions requiredLoss of dataDifficultyIt works on new models.
Mi AccountLinked account, Internet❌ No.β­βœ… Yes.
Recovery (delete gesture.key)SD-Map, access to File Manager❌ No.⭐⭐⚠️ Partially.
Hard Resetβ€”βœ… Yes (full)β­βœ… Yes.
ADBUSB debugging enabled❌ No.⭐⭐⭐❌ No (on new firmware)
Service centrePhone IDs.❌ No.β­β­β­β­βœ… Yes.

πŸ’‘

The most universal methods are unlocking through Mi Account and Hard Reset, the first one saves data, the second one is guaranteed to work, but it will delete everything from the phone.

FAQ: Frequent questions about resetting a pattern lock

Can I unlock Xiaomi without losing data?
Yes, if: πŸ”Ή You have a Mi Account and access to the Internet. πŸ”Ή The phone's debugging on. USB (method ADB). πŸ”Ή You can delete gesture.key file via Recovery. In all other cases, the data will be lost.
Why does the phone ask for an old Mi Account after Hard Reset?
This is a protection against theft (Factory Reset Protection, FRP). If the phone was linked to Mi Account, you're going to need to login and password from that account after the reset, and you're not going to be able to use the device without it: πŸ”Ή Restore access to your account through [account.xiaomi.com](https://account.xiaomi.com/). πŸ”Ή Provide proof of purchase at the service center.
Does a reset with Google Account work on Xiaomi?
Unlike phones on pure Android, Xiaomi does not support unlocking through Google Account. The only official way is Mi Account.
Can I get a pattern lock?
Theoretically, yes, but: πŸ”Ή At Xiaomi after 5 And the unbelievers will be able to do it. 30 second 24 hours). πŸ”Ή Number of possible combinations of key β€” 389 112 (patterned 4Γ—4). πŸ”Ή Automatic matching software (such as Android Pattern Unlock) requires root rights and only works on older firmware. In practice, key selection takes too long and often results in a device being completely locked.
What to do if the phone is discharged during unlocking?
If the phone is turned off during the reset procedure (e.g. in Recovery Mode), Charge it to at least 30%. Repeat reset attempt. If the phone doesn't turn on, plug it into charging for 10-15 minutes, then try pinching the Volume up. + Meals for entering Recovery. ⚠️ Do not interrupt the reset process – this can cause firmware damage!