How to Unblock Xiaomi If You Forgot Your Graphic Password

When you pick up Xiaomi to check notifications and the screen greets you with a request to enter a forgotten pattern lock, it causes panic. This is a common problem faced by users who have installed sophisticated protections for data security. Fortunately, the MIUI ecosystem has several mechanisms for access recovery, each with its own nuances and conditions of applicability.

Restoring access to a device depends on many factors: operating system version, having a Mi Account tied, USB debugging enabled and smartphone model. Some methods allow you to save personal data, others require a complete reset. In this article, we will discuss in detail all the current ways to bypass the lock so that you can choose the most suitable for your case.

Before you start taking action, you need to assess the current state of the gadget, and if the device is connected to the Internet, and you remember the data from the account, the process will go as smoothly as possible, but if the graphic password was set long ago and the account is not tied, you will have to resort to more radical measures, including hardware reset.

Using a Mi Account to Unblock

The most civilized and safe way to get back to the system is to use the Forgot Password feature, which is built into the lock interface, which only works if the smartphone is connected to a Wi-Fi or mobile Internet network, and the system has activated a Mi Account. After five failed attempts to enter the key, the β€œForgot the pattern lock” or β€œForgot the password” button should appear on the screen.

By clicking this button, the system will redirect you to the Xiaomi server authorization page, where you will need to enter your account login and password, which is a mechanism for protection against theft, so you can not log in without the right data, and successful authorization will allow you to reset the current key and install a new one or remove the protection altogether.

  • πŸ”‘ Enter the wrong key 5 times in a row to get the recovery menu.
  • 🌐 Make sure your device has an active internet connection.
  • πŸ“² Enter the Mi Account that was previously used on this device.
  • βœ… Confirm the reset and set a new unlock combination.

It is important to note that newer versions of MIUI (beginning with 12 and above) may not be available unless it has been pre-enabled in the security settings, which is designed to enhance the protection of user data from unauthorized access.

πŸ’‘

If the Forgot Password button doesn’t appear after 5 attempts, wait 30 seconds and try entering the key 5 more times.

Resetting settings via Recovery Mode

If you don't remember your account, the only way out is to completely reset your device to the factory's Hard Reset, which is guaranteed to remove the pattern lock, but with it, all user data β€” contacts, photos, apps and correspondence β€” will be destroyed, and the operation is performed through the Recovery menu, which is available even when the screen is locked.

To enter recovery mode, you need to turn off your smartphone completely. Then you need to press the button combination, which depends on the model, but most often it is Volume Up + Power. You need to hold the buttons until the Mi logo appears or the menu appears on a black background. In some cases, the menu may be in Chinese, then you will have to navigate by icons or the location of items.

β˜‘οΈ Reset algorithm via Recovery

Done: 0 / 4

In the menu, the navigation is done with volume buttons, and the choice is confirmed by the power button (or touch if the screen reacts). You need to find Wipe Data or Wipe & Reset. After selecting, the system will ask you to confirm the action, often requiring you to enter the word "yes" or select "Confirm."

⚠️ Warning: After resetting via Recovery, the device will work protection FRP (Factory Reset Protection. You'll need to enter the username and password from the Google account that was synced to the phone before locking. Without this data, you won't be able to turn the phone on.

There is a nuance for devices with MediaTek processors, where sometimes the method of resetting through utilities on a PC helps, but for most users, the standard path through Recovery Mode is the only working option without the use of complex software.

πŸ“Š Have you encountered a blockage? FRP post-discharge?
Yes, I had to remember the Google password.
No, the account was untied in advance.
I use my phone without accounts.
I don't know what FRP is.

Unlocking through debugging via USB and ADB

For advanced users who had pre-debugging enabled USB, There's a way of removing the key file through the computer, and this way of saving the data, because we don't do a complete reset, we just delete the system file that stores the graphical password, USB-cable and installed set of tools ADB (Android Debug Bridge).

The idea is to connect the locked smartphone to the computer and input a special command into the console. If debugging access is allowed, the computer will "see" the device, and we can command to delete the system file gesture.key or password.key. This is true for older versions of Android, in new versions of MIUI access to these files without root permissions is often closed.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/password.key

If the command is successful, you need to restart the device. Once enabled, the lock should disappear or you can enter any pattern lock. However, if the device has security patches higher than Android 6-7, this method may not work without superuser rights.

  • πŸ’» Install the drivers. ADB computer.
  • πŸ”Œ Connect your phone with a cable to your PC.
  • ⌨️ Enter the command to delete the key file in the terminal.
  • πŸ”„ Reboot the device with the adb reboot command.
What if the ADB can’t see the device?
If the computer does not emit sounds and does not determine the device when connecting, perhaps there is a ban on connecting on the lock screen. USB. Try to connect the phone through USB-Hub with a button, first connecting the hub to the PC, and then inserting the cable into the phone while the screen is still burning.

Google's Find My Device Service

An alternative way that can work is if you log in to your Google account and geolocate it. Find My Device not only tracks your location, but also manages your security remotely, and if you log into your phone from any other device, you can see your blocked Xiaomi on the list.

The management interface has three basic functions: Play, Lock, and Clear. We're interested in a cleaning feature that's actually similar to resetting through Recovery, but it's done remotely. This is a good option if the volume buttons on the phone are faulty or the screen doesn't respond to touch, making it impossible to log in to Recovery.

Keep in mind that to work this method, the phone must be turned on and have access to the Internet. If the device was turned off or is in flight mode, the reset command will be executed only after the first connection to the network.

MethodData retentionWe need the Internet.Difficulty
Mi Account.Yes.Yes.Low.
Recovery ModeNo.No.Medium
ADB (key file)Yes.No (PC needed)Tall.
Find My DeviceNo.Yes.Low.

πŸ’‘

Find My Device is the last hope if physical access to the smartphone buttons is limited but remote control is active.

Engineering menus and third-party utilities

There is a myth that you can unlock Xiaomi through an engineering menu by typing a special code in the "ringer." Unfortunately, when the screen is locked, you can't run the dialer, so codes like ##7780## are useless in this situation. This method only works if the phone is unlocked, but you want to reset.

However, there are specialized PC programs such as Mi Flash Unlock or third-party utilities (e.g. 4uKey, Tenorshare) that often offer paid solutions to remove the screen lock, and they work on the principle of forced flashing or exploiting vulnerabilities in the bootloader.

Using third-party software carries risks: you can get a virus on your PC or β€œbrick” your phone if you don’t have the right firmware. Moreover, most effective programs require an unlocked Bootloader, which is impossible to get on a locked screen, so this path is recommended only for experienced users who are ready for experiments.

⚠️ Warning: Beware of programs that promise to unlock any phone in 5 seconds for free, most often fraudulent software that requires payment after "scanning" or installing malicious modules.

If none of the software methods worked, you can contact the authorized service center Xiaomi. Upon presentation of the check for the purchase and box with IMEI-code, specialists can remove the lock. This is the only legal way to guarantee the preservation of the functionality of the device, if you do not want to risk independent actions.

Prevention of blocking and advice

To avoid getting caught off guard by a forgotten password, it’s important to keep digital hygiene up to date, check regularly if syncing with Mi Cloud and Google is active, write down a complex password in a safe place, or use a password manager, as human memory is prone to errors, especially when we come up with complex combinations for security reasons.

It is also useful to check the USB debugging periodically if you are a technical user, and enabling this feature opens up additional ways to restore the system in critical situations. Don’t ignore system updates, as they often fix bugs that can lead to false locks or interface tanks.

  • πŸ“ Write passwords in a physical notebook or secure storage.
  • ☁️ Regularly back up important data to the cloud.
  • πŸ”’ Do not install too simple graphic keys (for example, the letter β€œG” or β€œL”), they are easy to pick up.
  • πŸ“¦ Keep a box and a check from your smartphone – it’s proof of ownership.

Remember that a pattern lock is only one layer of protection: biometrics (fingerprint or face unlock) MIUI It is often more convenient, but it also requires a backup. PIN-Using biometrics reduces the risk of forgetting access, because your finger or face is always with you.

Can I unlock Xiaomi without losing data?
Without data loss, you can only use a Mi Account (if the function was active) or an ADB (if debugging was enabled and there is root), and 95% of the time, if the key is forgotten, the data will have to be deleted.
What to do if your phone requires a Mi Account after a reset (FRP)?
This is anti-theft protection. You need to enter the login and password from the Google account that was on the phone before the reset. If you don't remember them, you can restore a Google account through your computer at accounts.google.com. You can bypass FRP without the owner's data.
Will your phone reset if you enter the wrong password 10 times?
No, the phone won't reset automatically after 10 attempts; it will only lock for an increasing time (from 30 seconds to several hours), and the complete deletion of data only occurs after a forced reset via Recovery or command from the computer.
Can I unlock Xiaomi remotely without access to my phone?
Remotely, you can only if the Find Device service was turned on and it is connected to the Internet, in this case, you can send a command to erase data through the Mi Cloud or Google Find My Device site, which will remove the lock on the screen, but delete all files.
Will the flashing help with Mi Flash?
Fastboot flashing through Mi Flash will completely clean the phone and install a clean system by removing the password. However, this often requires an unlocked bootloader, which you can't get on a locked phone.
Is there a universal code to unlock Xiaomi?
Any information on the Internet about β€œsecret codes” to unlock without losing data is likely fake or designed for very old versions of Android, not relevant to modern Xiaomi.