Forgot your phone password or want to update it for more security? On Android, you can change the lock code in several ways - from standard settings to recovery via account Google. But it is important to understand: the procedure depends on the version of the operating system, device model and even manufacturer. For example, on Samsung Galaxy s One UI the path to the security settings differs from the pure Android 14 on Pixel 8.
In this article we will analyze all the current methods of changing the password, including emergency ones - when access to the phone is lost. You will learn how to bypass the blocking without losing data (if possible), which ones, and why some methods stopped working after updates. We will also analyze which types of locks ( resetting to factory settings carries risks, and why some methods stopped working after updates Android 12+. We will also analyze what types of locks (PIN, pattern, fingerprint) can be changed remotely, and which ones can only be changed manually.
1. Standard method: changing the password through settings
If you remember the current lock code, the easiest way is to use the built-in security settings. This method works on all devices, regardless of brand (Xiaomi, Huawei, Realme etc.), but may differ slightly visually.
Open the menu Settings โ Security and privacy โ Screen lock. The system will ask you to enter your current password, PIN or pattern. After confirmation, select a new lock type:
- ๐ข PIN code โ from 4 to 16 digits (at least 6 are recommended for security).
- ๐ Password โ a combination of letters, numbers and symbols (most reliable option).
- ๐จ Pattern key โa pattern of 4โ9 dots (less secure, but convenient).
- ๐ Fingerprint/face โbiometrics (requires a backup PIN/password).
On some devices (for example, Samsung s Knox), when changing the password, a warning about data reset may appear in applications Secure Folder or Samsung Pay. This is normal - this is how corporate feature protection works.
Current lock code at hand|Battery charge > 20%|Backup important data|VPN/proxies are disabled (can block synchronization)
-->
โ ๏ธ Attention: If you use managed workspace (for example, via Microsoft Intune or VMware Workspace ONE), changing the password may block access to corporate data. Check the security policy with your IT department administrator.
2. Changing your password through your Google account (if you forgot your current one)
If you have forgotten the lock code, but your phone is linked to your account Google, you can try to restore access through Find My Device (formerly "Device Manager"). This method only works if three conditions are met:
- The device is connected to the Internet (via a mobile network or Wi-Fi).
- The function is enabled
Find devicein the settings (Settings โ Google โ Security). - You remember the login and password for the account Googlethat was added on the phone.
Instructions:
- Go to the site
google.com/android/findfrom another device. - Select a locked phone from the list (if there are several of them).
- Click
Lock deviceand enter a new temporary password. - Use this password to unlock the phone, then set a permanent code in the settings.
| Manufacturer | Support Find My Device | Features |
|---|---|---|
| Google Pixel | Yes | Works stably, supports remote PIN change. |
| Samsung | Yes, but with reservations | May require confirmation via Samsung Account. |
| Xiaomi/Redmi | Partially | On some models it is blocked after 5 unsuccessful attempts. |
| Huawei (without GMS) | No | Use Huawei Cloud or reset. |
โ ๏ธ Attention: On devices with Android 11+ and enabled File-Based Encryption (FBE) remote password change via Find My Device may lead to data loss in some applications (for example, WhatsApp or Signal). This is due to changing the encryption keys.
PIN code|Pattern key|Password|Fingerprint/face|I do not use a lock
-->
3. through Recovery mode (for experienced users)
If the previous methods did not work, you can only do so through the menu hardware. reset via menu Recovery. This method will delete all data from the device, including photos, messages and installed applications. Use it only as a last resort!
Steps for most devices:
- Turn off the phone.
- Hold down the combination of buttons to enter
Recovery(depending on the model):- ๐ฑ Samsung:
Volume up + Power + Bixby(orVolume up + Poweron new models). - ๐ฑ Google Pixel, OnePlus:
Volume down + Power. - ๐ฑ Xiaomi:
Volume up + Power(hold for 10+ seconds).
- ๐ฑ Samsung:
Recovery select Wipe data/factory reset (control - volume buttons, confirmation - power button).Reboot system now).What to do if you canโt enter Recovery?
If the button combination does not work, your device may be using Fastboot Mode instead of classic Recovery. In this case:
1. Connect your phone to a PC with installed drivers. data-i="131">2. Enter the command: ADB.
2. Enter the command:
adb reboot recovery
3. If this does not work, try:
fastboot reboot recovery
On some models Huawei and Honor a special unlock code may be required (it is provided by the manufacturer upon request).
After the reset, you will need to reconfigure the phone, including linking the account Google. If the function was previously enabled Reset protection (FRP), the system will ask for the login and password from the last synchronized account.
4. Using ADB to change the password (without losing data)
For advanced users, there is a way to change the password via Android Debug Bridge (ADB)without losing data. This method only works if the phone USB debugging is enabled has access to a PC with installed drivers.
Instructions:
- Connect the phone to the PC via a USB cable.
- Open the command line (
cmdon Windows orTerminalon macOS/Linux). - Enter the commands in order:
adb shellsu
rm /data/system/gesture.key # for pattern key
rm /data/system/password.key # for PIN/password
rm /data/system/locksettings.db
rm /data/system/locksettings.db-wal
rm /data/system/locksettings.db-shm
reboot - After reboot, the phone will unlocked, but you will need to set a new password.
- ๐ With 5 unsuccessful attempts to enter the password, the phone is locked for 30 seconds, then time. increases.
- ๐ฑ To reset your password via Mi Account requires linking a phone number.
- ๐ Some versions of MIUI have a function
Password recoveryvia SMS (a code is sent to the linked number). - ๐ On devices without Google Mobile Services (GMS), password reset is only possible through Huawei ID.
- ๐ต If you have forgotten the password for Huawei ID, you will need to contact support with proof of ownership of the device.
- ๐ On new ones models with HarmonyOS reset via
Recoverymay require entering unlock codeissued by the manufacturer. - ๐ When changing the password, the contents of the folder may be reset.
Secure Folder. - ๐ฑ Supports unlocking via Samsung Find My Mobile (alternative Find My Device).
- ๐ On devices with Knox some corporate data may be blocked after a reset.
- ๐ Add backup PIN for biometric locking (print/face).
- ๐ง Link your account Google and check that the function
Find deviceis enabled. - ๐ On Samsung set up
Samsung Find My Mobilewith a backup phone number. - ๐ก๏ธ Activate device encryption (
Settings โ Security โ Encryption). - ๐ Set automatic blocking after 30 seconds of inactivity.
- ๐ก Disable
Smart Lock(auto-unlock in trusted locations) if it is not needed.
โ ๏ธ Attention: On devices with Android 10+ and enabled File system encryption (FBE) this method may lead to Loss of access to data in /sdcard/ folders and some applications. The reason is a change in encryption keys when deleting lock files.
If the commands su do not work, then there is no data on the phone root access. In this case, try the alternative method via ADB backup, but it requires additional manipulations and does not guarantee 100% results.
adb backup -apk -obb -shared -all -f backup.ab
This will save applications and their data (but not system lock settings).
-->
5. password on devices with MIUI, EMUI and One UI
Manufacturers often modify the standard Android, adding their own security features. Let's look at the key differences:
Xiaomi (MIUI):
Huawei (EMUI/HarmonyOS):
Samsung (One UI):
-->
6. How to protect your phone after a change password
After successfully changing the lock code, it is recommended to take several steps to strengthen security:
1. Set up backup unlocking methods:
2. Enable additional security measures:
3. Check active sessions:
- Go to
Settings โ Google โ Google account management โ Security. - In the section
Your devicesdelete unknown sessions. - Enable two-step authentication for your account Google.
If you often forget passwords, consider using manager. passwords (for example, Bitwarden or 1Password) to store backup codes. Do not store PIN codes in notes or SMS!
Frequent errors and how to avoid them
When changing a password, users often encounter typical problems. Here are the most common ones and ways to solve them:
1. "Cannot change the password - the system writes 'Error'"
- ๐น Check whether guest mode or second user.
- ๐น Make sure there is enough free space on the device (less than 10% of memory can block changes settings).
- ๐น Reboot the phone and try again.
2. "After resetting via Recovery, the phone requires the old password"
- ๐น This is a manifestation FRP (Factory Reset Protection)Enter the details of the last synchronized account. Google.
- ๐น If the account is not remembered, use
google.com/android/findto unlock. - ๐น On Samsung you may need to enter data Samsung Account.
3 "The pattern key is not accepted, although I enter it. correct"
- ๐น Try entering the pattern more slowly - the system may not have time to register touches.
- ๐น Check if the mode is enabled
Invisible PIN(on some firmware it hides the input). - ๐น If the pattern is really forgotten, use account Google or reset.
โ ๏ธ Attention: On some devices (for example, OnePlus s OxygenOS) after several unsuccessful attempts to enter the password, it may work. hardware locking of the bootloader. In this case, unlocking is possible only through an official service center with confirmation of purchase.
FAQ: Answers to popular questions
Is it possible to change the password on Android without data loss?
Yes, but only if you remember the current lock code (via settings) or if USB debugging is enabled on your phone (via ADB). In other cases (forgotten password), resetting will lead to data deletion.
Why did some applications stop working after changing the password?
This is related. with File-based encryption (FBE)which is used in Android 10+. When you change the password, the encryption keys change, and some applications (for example, WhatsApp or banking) may require re-authentication.
How to change the password to phone with a broken screen?
If the screen responds to touches, connect the phone to the PC via USB-OTG and use the mouse. If the screen is completely inoperative, try connecting via ADB (if debugging was enabled) or contact a service center to replace the display.
Is it possible to bypass the blocking through a call or SOS?
No, modern versions of Android (starting from Android 9 Pie) have closed this vulnerability. Previously, it was possible to access the settings through the emergency call screen, but now this is impossible.
What to do if the phone is blocked by the operator (for example, when purchased with hands)?
This is IMEI lock, it is not related to the screen unlock code. Contact the operator with proof of purchase or check the phone through the service imei.info before purchasing.