How to take it off PIN-Xiaomi phone code: from simple reset to unlock through ADB

Forgotten. PIN-Xiaomi code and you can't unlock your phone, or you just want to remove the security that prevents quick access β€” 5 working methods of pin-code removal, from standard settings to advanced technical solutions, we will discuss the options without loss of data (if the phone is unlocked) and ways of complete reset for locked devices, including the Redmi Note models. 10/11/12, POCO X3/X4/X5, Mi 11/12/13 others.

Important: the procedure depends on the version of MIUI (12/13/14) and the status of the Mi Account. For example, on devices with MIUI 14 and associated Mi Account, additional recovery options are available.

If there are important files on your phone, try the non-reset methods first (sections 2–3). If the screen is completely locked, go to sections 4–5, but be prepared to delete the information.

πŸ”Ή Brief navigation on the article:

  • πŸ”“ Withdrawal PIN Settings (if the phone is unlocked)
  • πŸ“± Unlocking with Mi Account (requires binding)
  • πŸ–₯️ Reset via Fastboot (for advanced users)
  • πŸ”§ ADB-teams (if debugging is included)
  • ⚠️ Hard reset (last option, data will be deleted)

1. How to clean up PIN-code through phone settings (if phone unlocked)

If you remember the current PIN and the phone is not locked, the easiest way is to turn off the protection in the settings menu.This method works on all Xiaomi models, including the Redmi 9/10/11, POCO F3/F4/F5 and the flagship Mi 12T/13.

πŸ“Œ Step-by-step instruction:

  1. Open the Settings app (cog icon).
  2. Go to the Passwords and Security section.
  3. Select Screen Lock.
  4. Enter the current one. PIN-proof-code.
  5. Click No or Delete Password (depending on the MIUI version).

⚠️

πŸ”΄ Note: If the phone has enabled the β€œData Protection when blocked” (encryption), the system may require you to enter a password from Mi Account even when you remove it. PIN. This is a Xiaomi security measure that can’t be circumvented without a reset.

πŸ’‘ What to do if there is no "Delete password" item?

  • πŸ”„ Update. MIUI Up to the latest version – in old firmware interface may differ.
  • πŸ“± Try changing the type of lock: first install the pattern lock, then delete it.
  • πŸ”§ If the phone is corporate, the administrator may have banned the change in security settings.
πŸ“Š What type of screen lock you use?
PIN-code
pattern lock
Fingerprint.
Facial recognition
No lockdown.

2 Unlocking through Mi Account (if the phone is linked to the account)

If you forget your PIN, but your phone is tied to your Mi Account, you can restore access through Xiaomi’s official service, which only works when you connect to the Internet (Wi-Fi or mobile network) and if you have previously enabled sync with your account.

πŸ”Ή Unblocking conditions through Mi Account:

  • πŸ“Ά Phone is connected to the network (even if the screen is locked, check Wi-Fi notifications).
  • πŸ”‘ You remember the username and password from Mi Account (email or phone number).
  • πŸ“± The device has enabled the function Find the device (in the account settings).

πŸ“ Unlocking instructions:

  1. On the locked screen, click Forgot Password? (or Forgot Password).
  2. Select the recovery option through Mi Account.
  3. Enter your email/phone and password from your account.
  4. Confirm unlocking via SMS or email (if two-factor authentication is enabled).
  5. Set a new PIN or remove the lock completely.

⚠️

πŸ”΄ Note: If you do not remember the password from Mi Account, you can restore it on account.xiaomi.com. email/This is not possible, Xiaomi does not provide alternative ways to restore the phone.

What if the "Forgot Password" button is not used?
On some models (e.g. POCO M3 or Redmi 8A), this option may not be available. In this case, try: 1. Connect the phone to your PC and use the Mi Unlock Tool (requires permission to unlock the bootloader). 2. Enter the wrong PIN 5-10 times in a row - sometimes a restore button appears. 3. Use the Fastboot method (section 4).

3. PIN reset via ADB (USB debugging enabled required)

If the phone is debugging on USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 times press to unlock the developer mode, you can remove PIN through ADB-This method saves data, but only works when the screen is unlocked (or if you can connect to a PC without locking it).

πŸ› οΈ What's the matter:

  • πŸ–₯️ Computer with Android installed SDK Platform-Tools.
  • πŸ“± USB-cable (original so that there are no connection problems).
  • βš™οΈ Included debugging by USB and permission to connect to this PC.

πŸ“‹ Step-by-step instruction:

  1. Connect your phone to your PC and open the Command Prompt (Windows) or Terminal (macOS/Linux) in the folder with the platform-tools.
  2. Check the connection command: Adb devices should appear serial number of the device.
  3. Enter the PIN removal command: adb shell rm /data/system/locksettings.db adb shell rm /data/system/locksettings.db-wal adb shell rm /data/system/locksettings.db-shm
  4. Reboot your phone: adb reboot

βœ… After the reboot, the lock will be reset. PIN, Just click Miss or Cancel.

⚠️

πŸ”΄ Attention: MIUI 14 And this method may not work because of the increased protection, so try the alternative command: adb shell su. -c "rm /data/system/gesture.key" (Root rights are required).

β˜‘οΈ Preparation for ADB-unlock

Done: 0 / 4

4. reset PIN via Fastboot (without data loss, but with the bootloader unlocked)

If USB debugging is disabled but you have access to Fastboot mode, you can try resetting the PIN through the persist partition firmware.This method does not delete user data, but requires an unlocked bootloader.

πŸ”§ What you need to know:

  • πŸ”“ Unlocking the bootloader erases all data on the phone (but not in this case, as we work with persist).
  • ⏳ The process can take 10 to 30 minutes.
  • πŸ“± Suitable for most Xiaomi models, except for some flagships (e.g. Mi 11 Ultra with enhanced protection).

πŸ“Œ Instructions:

  1. Turn off your phone and press the Power button + Volume down to log into the Fastboot.
  2. Connect your device to your PC and check for detection: fastboot devices
  3. Download the firmware for your model (select the Fastboot version).
  4. Unpack the archive and find the file persist.img.
  5. The command section: fastboot flash persist persist.img
  6. Reboot the phone: fastboot reboot

πŸ”„ After the reboot. PIN-If you have a request to create a new password, skip this step.

⚠️

πŸ”΄ Note: On some models (e.g, POCO F4 GT or Redmi K50) Persistent firmware can cause the camera or sensors to crash, and you'll have to flash a full Fastboot-ROM with data loss.

πŸ’‘

If the fastboot flash persist command does not work, try to unlock the bootloader first using the official Mi Unlock Tool. This will take 7-15 days of waiting, but ensures stable operation.

5 Hard Reset - The Last Option

If no methods have worked, you can completely reset your settings through Recovery Mode, which deletes all data (photos, contacts, messages) but is guaranteed to unlock your phone.

⚠️ When to use Hard Reset:

  • πŸ”’ You forgot. PIN and the password from the Mi Account.
  • πŸ“΅ Debugging by USB It is disabled and Fastboot is not helping.
  • πŸ“± The phone was bought from hand and the previous owner did not remove the lock.

πŸ”„ How to make a hard reset:

  1. Turn off the phone.
  2. Press the Power button + Volume up to enter Recovery Mode.
  3. Use volume buttons for navigation and power button for selection.
  4. Choose Wipe Data β†’ Wipe All Data.
  5. Confirm the reset (usually you need to enter Yes).
  6. After completion, select Reboot.

❌ What will be removed:

Type of dataRemoved?Can we restore it?
Contactsβœ… Yes.βœ… If synchronized with Google/Mi Account
Photos and videosβœ… Yes.❌ Without a backup, no.
Messages (SMS)βœ… Yes.❌ Not (unless there was a backup)
Installed annexesβœ… Yes.βœ… You can reinstall from Google Play
System settingsβœ… Yes.❌ No. They'll drop to the factory)

⚠️

πŸ”΄ Attention: On phones with MIUI 13/14 And the File-Based Encryption, after reset, may require you to enter the Mi Account password, or the device will not boot. If you don't remember the password, the phone will turn into a brick, you'll need to run the firmware through the device. EDL-The service (only in the service center).

πŸ’‘

Hard reset is a last resort. If your phone has important data, try connecting it to your PC in Fastboot mode and copying files via adb pull /sdcard/ (if debugging was enabled earlier).

6.Alternative methods: bypassing PIN through service centers and EDL

If the independent methods do not work, professional solutions remain:

  • πŸ”§ Xiaomi Service Center – Official Unblocking (requires a check or confirmation of purchase).
  • πŸ”“ EDL-Emergency Download Mode – Firmware through a special cable (risky for beginners).
  • πŸ“± Unlock Services – Paid services like DC-Unlocker or Mi Flash Pro (beware of scammers!).

πŸ’° Cost and risk:

MethodCost (β‰ˆ)Risks.Timeline
Official Xiaomi service1 500–3 000 β‚½Low (guarantee maintained)1-5 days
Firmware through EDL1 000–2 500 β‚½High (risk of "bricking")1-2 hours
Paid online services500–1 500 β‚½Medium (fraud, viruses)5-30 minutes

⚠️ Fraudster warning:

  • 🚨 Don’t trust services that ask for advance payment without warranties.
  • πŸ”— Don't download "breakers." PIN" From a questionable website, it could be a virus.
  • πŸ“„ Always check the reviews of the service center before contacting.

7.How to avoid blocking in the future

To avoid facing the problem of a forgotten PIN again, follow these tips:

  • πŸ” Use biometric unlocking (fingerprint or face) as a backup option.
  • πŸ“ Write it down. PIN Password Manager (e.g. Google Password Manager or KeePass).
  • πŸ”„ Make backups regularly through Settings β†’ System system β†’ Backup.
  • πŸ“§ Link Mi Account and enable data synchronization.

πŸ”Ή Security settings that are worth checking:

  1. Open Settings β†’ Passwords and Security β†’ Locking settings.
  2. Make sure you have enabled the Unlock option via Mi Account.
  3. Add a spare PIN or pattern lock.
  4. Set up a Smart Lock (automatically unlock in secure places, such as at home).

πŸ’‘

If you often forget passwords, install the Xiaomi Cloud app and enable automatic data synchronization, which will help restore access to contacts and files even after a reset.

FAQ: Frequent questions about removing PIN on Xiaomi

❓ Can I get rid of it? PIN without data loss if the phone is locked?
Yes, but only if: πŸ“± The phone is linked to Mi Account and has internet access. πŸ–₯️ Debugging is on. USB (method ADB). πŸ”§ The bootloader is unlocked (for the Fastboot method), and if none of these are available, you'll have to do a Hard Reset with data loss.
❓ Why does he need a password from his Mi Account?
This is Factory Reset Protection (FRP) that is activated if the phone has been encrypted or Mi Account tied. To get around: Enter the correct password from your account. If you don't remember, restore it to account.xiaomi.com. If your account is not yours (the phone is bought by hand), contact the service center with proof of purchase.
❓ Does the way with ADB on MIUI 14?
On MIUI 14 and later, the method of removing locksettings.db may not work due to the increased protection. Alternatives: Use the command with su (root rights required). Try flashing persist.img through Fastboot. If nothing works, only Hard Reset.
❓ Can you unlock Xiaomi without a Mi Account?
Technically yes, but with reservations: πŸ”§ Through EDL-mode (requires a special cable and firmware). πŸ“± If the phone is old (before 2019), sometimes it helps to exploit in Recovery. ⚠️ New models (Redmi Note 12, POCO X5) Without Mi Account, unlocking is almost impossible. πŸ’‘ Tip: Before buying a used Xiaomi phone, always check if it is tied to someone else’s account!
❓ How to protect yourself from blocking for the future?
Follow these rules: πŸ” Use biometrics (fingerprint/face) as the primary way to unlock. πŸ“§ Link Mi Account and enable synchronization. πŸ“ Keep it. PIN In a secure location (e.g., Google Keep with encryption). πŸ”„ Make backups regularly through Settings β†’ System system β†’ Backup.