How to unlock Xiaomi if you forget your graphical password without losing data

The forgotten graphical password on Xiaomi’s smartphone is a situation that one in five users face. The main problem is that most standard unlock methods (for example, through Mi Account) require a factory reset, which leads to complete loss of data β€” photos, contacts and messages.

In this article, we will discuss 4 working methods for unlocking Xiaomi, Redmi and POCO with saving data β€” from using ADB to bypassing Fastboot mode. Importantly, the effectiveness of methods depends on the version of MIUI, the device model and the availability of debugging over USB. If you have never connected your phone to your computer before, the chances of success are reduced β€” but not zero.

Before you start, check:

  • πŸ”Œ Do you have access to a computer with Xiaomi drivers installed?
  • πŸ“± Is the phone debugging enabled? USB (Even if you don’t remember, try all the methods in order).
  • πŸ”„ Is the phone connected to Mi Account (Xiaomi account)?
πŸ“Š Your Xiaomi smartphone is connected to your Mi Account?
Yeah, and I remember the password.
Yeah, but the password's forgotten.
No, not connected.
I remember.

1. Unlock via ADB (if USB debugging was enabled)

It only works if you've previously activated USB debugging in the developer's settings, and it's the most reliable way to save data, but it requires preparation.

What you need:

  • πŸ’» Computer with Windows or macOS.
  • πŸ”Œ USB-Type-C Cable (original, undamaged).
  • πŸ“₯ Utility. ADB (Android Debug Bridge. Download it from the official website.

Step-by-step:

  1. Connect your phone to your computer. The USB Debugging Notice will appear on the lock screen, confirm it (if the phone allows).
  2. Open the command prompt (Windows) or Terminal (macOS) in the folder with ADB.
  3. Enter the command to check the connection: adb devices If the device is displayed, proceed to the next step.
  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 adb shell rm /data/system/locksettings.db-wal adb shell rm /data/system/locksettings.db-shm
  5. Reboot your phone: adb reboot

After the reboot, the graphical password will be reset and the data will remain intact. If the command does not work, try an alternative:

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


adb shell input text 1234




adb shell input keyevent 66

It mimics input. PIN-1234 (if previously reserved) PIN).

Download ADB and unpack it into a separate folder |

Connect your phone to your computer with the original cable|

Check the display of the device by the command `adb devices`|

Delete gesture.key or locksettings.db| files

Reboot the phone after completing commands-->

πŸ’‘

If the team `adb devices` Does not show your Xiaomi, install Mi drivers PC Suite or manually update the driver through Device Manager (Windows).

2. use of Mi Account (if the phone is linked to the account)

If your Xiaomi is tied to Mi Account and you remember the username and password, this method will work 90% of the time, but on some models (for example, Redmi Note 10 Pro or POCO X3 Pro) after unlocking, you may need to reset your settings.

Instructions:

  1. On the lock screen, tap Forgot Password? (or Forgot Password?).
  2. Select Sign in via Mi Account.
  3. Enter your email/phone and password from your Xiaomi account.
  4. Confirm unlocking via SMS or email (if two-factor authentication is enabled).

⚠️ Warning: If the system offers a reset after you log in, cancel the operation and try other methods (MIUI 12.5+) This method leads to loss of data.

Xiaomi modelSupports unlocking through Mi Account without resetting?Is the Internet necessary?
Redmi Note 8/9/10Yes (on MIUI 11-12)Yes.
POCO F3/X3Partially (possible reset)Yes.
Mi 11/12 SeriesNo (reset required)Yes.
Redmi 7A/8AYes (on all versions of MIUI)No.

3. Unlock via Fastboot mode (for advanced users)

This method is suitable if USB debugging is disabled, but you have access to Fastboot mode.It requires the installation of a custom recavator (such as TWRP), which can lead to a loss of warranty.

⚠️ Note: Fastboot missteps can permanently block the bootloader. Use this method only if you are confident in your skills.

Step-by-step:

  1. Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
  2. Connect your phone to your computer and check the connection: fastboot devices
  3. Unlock the bootloader (if it is blocked): fastboot oem unlock This will delete all data! If the goal is to save files, skip this step and move on to the next one.
  4. Install TWRP (if bootloader unlocked): fastboot flash recovery twrp.img fastboot boot twrp.img
  5. In TWRP, go to Advanced β†’ File Manager and delete files: /data/system/gesture.key /data/system/locksettings.db
  6. Reboot the phone.

If the bootloader is locked and unlocking through the Mi Unlock Tool requires a wait (usually 7-30 days), this method is not suitable for urgent unlock.

What if the fastboot can’t see the device?
If the team `fastboot devices` If you don’t show your Xiaomi, try 1. Install drivers manually through Device Manager (select β€œAndroid Bootloader Interface”). 2. Use another. USB-3. Run the command line on behalf of the administrator. 4. Reinstall the Mi Flash Tool from the official Xiaomi website.

4. Bypassing locks via Safe Mode (for MIUI 12 and later)

On some firmware (MIUI 12+), you can temporarily disable the pattern lock by booting into Safe Mode, which works if the lock is installed through third-party software (for example, AppLock).

Instructions:

  1. On the lock screen, hold the Power button until the off menu appears.
  2. Press and hold Turn Off (or Reboot to Safe Mode, if any).
  3. Confirm the download in Safe Mode.
  4. After downloading, uninstall the application that installed the pattern lock (such as Smart Lock or AppLock).
  5. Restart your phone in normal mode.

If the lock is set at the system level (Native MIUI pattern lock), this method will not work.

5. Alternative methods: what to do if nothing helps

If all of these methods fail, extreme measures remain:

  • πŸ”„ Reset via Mi Cloud: If your phone is connected to Mi Account, you can remotely reset your settings via i.mi.com.
  • πŸ› οΈ Contact the service center: Official centers Xiaomi can unlock the phone on the documents (passport) + Cost: 1000 to 3000 rubles.
  • πŸ”“ Operational vulnerabilities: On some models (Redmi) 5/6/Note 5) Vulnerabilities are being exploited EMMC or EDL-mode, but they require special equipment (UFi Box, EasyJTAG).

⚠️ Note: Use of unofficial services to unlock through EDL It may lead to a blockage. IMEI Check the workshop reviews before contacting.

6. How to avoid future data loss

To avoid the problem of forgotten passwords again, follow these guidelines:

  • πŸ” Set up a backup. PIN-code in lock settings (Settings) β†’ Password and security β†’ Screen locking).
  • ☁️ Enable automatic backup in Mi Cloud (Settings) β†’ Mi Account β†’ Mi Cloud β†’ Backup).
  • πŸ“± Activate Smart Lock (unlocking by trusted devices/places) in Settings β†’ Password and security β†’ Smart Lock.
  • πŸ–₯️ Connect your phone to your computer regularly and check your work. ADB (at least once in 3 months).

If you often forget passwords, use password managers (like Bitwarden or KeePassDX) to store backups. PIN-code.

πŸ’‘

Even if you successfully unlocked Xiaomi without losing data, set up your backup PIN and cloud backup immediately.

FAQ: Frequent questions about unlocking Xiaomi

Can I unlock Xiaomi without a computer?
Yes, but only if the phone is tied to Mi Account and you remember the password, otherwise the computer is needed to work with ADB or Fastboot.
Why did the data disappear from Mi Account after being unlocked?
On new firmware (MIUI 12.5+), Mi Account login can automatically trigger a reset, depending on the model and regional firmware. To avoid data loss, use ADB.
Does the method work with ADB on Xiaomi with a blocked bootloader?
Yes, ADB doesn't require an unlocked bootloader, but the main condition is that you have USB debugging enabled before locking, and if debugging is disabled, this method won't work.
Can I recover data after resetting via Mi Cloud?
Partially. If you backed up Mi Cloud before blocking, you can restore contacts, notes, and some settings. Photos and videos are only restored if they're synced with Google Photos or Mi Cloud.
What if Xiaomi asks for an old password after resetting?
This happens if you have a backup password set before, try to enter the last PIN you use or the pattern lock, and if you don't remember, you'll have to reset completely through Fastboot erase userdata.