How to unlock the Bootloader on Android devices.
Updated: May 21
Unlocking the bootloader of your Android device allows you to boot/flash custom ROMs, recoveries, etc. It also allows you to flash your device with the latest factory software image, which is useful for unbricking devices. Unlocking the bootloader is mandatory if you wish to root your device. Newer Android devices have a slightly different way of unlocking the bootloader than older ones, however it is still very simple and easy to do.
Warning: Unlocking the bootloader will factory reset your phone! Ensure all your personal data is backed up before proceeding.
Note: Some manufacturers such as Nokia are known to put restrictions on your ability to unlock the bootloader. This method works without fail on all Google Pixel/Nexus devices, however may not be possible on certain other devices. It is your responsiblity to check compatiblity beforehand or proceed at your own risk. Some devices such as Samsung have a proprietary bootloader which is not unlockable via this method.
On your phone:
1. Open system settings.
2. Scroll to the bottom and select "System".
3. Select "About Phone".
4. Locate the build number. Tap it 7 times. If you have a screen lock in place, you'll be prompted to confirm it.
5. You should see a bubble appear at the bottom of the screen saying "Developer mode has been enabled" or something similar if done successfully.
6. Now return back to the previous menu. You should now see the "Developer options" appear. Click it.
7. Scroll down to find the "OEM unlocking" toggle. Turn the toggle on. If the toggle is greyed out, then your manufacturer does not allow you to unlock the bootloader, as stated above.
8. Also turn on the "USB debugging" toggle.
On your PC:
Download and setup ADB & Fastboot binaries. (Read: How to setup ADB & Fastboot on Windows, MacOS and Linux). If you are using Windows, make sure the correct USB Drivers are installed. Google's USB driver for Pixel/Nexus devices can be found here.
1. Now you must connect the phone to the PC using a USB cable. If you are asked to allow USB to transfer files, click "Allow".
2. Open a command prompt (Windows) or terminal (MacOS / Linux). If you are on Windows, remember to cd to the directory containing the ADB & Fastboot binaries.
3. Establish an ADB connection to the device by running adb devices. You may be prompted on your phone to allow USB debugging. If successful, you'll see your device's serial number displayed.
4. Reboot into the bootloader. Send the following command:
adb reboot bootloader
Alternatively you can push the key combination on your device if you know what you are doing. Our guide shows the ADB method because the same method works for all devices.
5. You will be presented with a screen. This is the bootloader. It may show "Download Mode" in the top corner, and/or you may see some device info. To unlock the bootloader, run the following command:
fastboot flashing unlock
NOTE: If the command fails, you can fall back to the old unlock command, fastboot oem unlock. This does the same as the command above.
6. After doing this, you'll be presented with a screen on your device confirming whether you want to unlock your bootloader. Use the volume keys to navigate and the power key to select. This is your last chance to back out before the bootloader becomes unlocked and your device gets reset!
7. Your bootloader is now unlocked and you are ready to flash away!
Note: While your bootloader is unlocked, you will see a warning message every time your system boots up. This is not an error message, and you do not need to worry when seeing this, however if you do not want to see this, it is recommended to lock the bootloader after performing any operations you want. This warning will go away automatically after 5-10 seconds, however you can skip it by pressing the power key (will need to press it twice if it says "Press power key to pause boot").
This step is entirely optional, however highly recommended since it allows the critical partitions on your device (such as the bootloader) to be flashed. This allows the device to be more easily recovered in case it gets bricked. Usually, flashing the stock firmware will require critical unlock as well as normal unlock. However, if you will never need to flash the critical partitions, you should not need critical unlock. To proceed, do the following:
1) Reboot back to bootloader.
2) Give the following command:
fastboot flashing unlock_critical
You will be prompted to unlock the bootloader once more, and your data will be erased once again :).
Locking the bootloader:
Just like before, locking the bootloader also factory resets your device. This locks the bootloader, factory resets, and removes the warning screen on every boot. The process is the same to lock, however this time you will run:
fastboot flashing lock
Confirm the lock. Your data will be erased. Reboot back to bootloader and run:
fastboot flashing lock_critical
That's it! Your bootloader is now re-locked.