26-07-2017, 02:47 PM
This guide will explain how to unlock and relock the bootloader of an Android device using fastboot. Except for rare cases like Motorola devices, your bootloader must be unlocked to flash even factory files via fastboot. While you can flash modified files (TWRP/GSI/Custom ROMs) to your Mediatek (MTK), Spreadtrum (SPD) or Qualcomm (QLM) Android devices using their flash tools on a locked bootloader, doing so is just asking for a boot loop or bricked device.
It is important to mention that this is a generic approach and doesn't work for all devices. Some relevant guides on bootloader unlock to checkout include:
- How to unlock Unisoc / Spreadtrum / SPD bootloader using an unlock token
- How to unlock Xiaomi bootloader using Mi Unlock Tool
- How to use mtkclient to unlock Mediatek bootloader
- How to unlock Motorola bootloader
- How to unlock and relock Samsung bootloader
- How to unlock Sony Xperia bootloader
Requirements
- Setup ADB-Fastboot on your PC. For Spreadtrum devices, follow this guide (in order to enable adb detect your device)
- Enable USB Debugging and OEM Unlocking (if available)
How to unlock Android bootloader using fastboot
Follow the steps below to unlock the Bootloader of an Android device
See the video tutorial below or @ https://youtu.be/DL5NMR-n4_Q
- Open the adb folder
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-1.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Hold Shift (on the keyboard) then right-click on a blank space in the folder > Select Open Command window here
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-2.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Command prompt screen (ADB) should now be open
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-3.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Connect the device to the PC (via USB cord) while ON then run the command below (by "run", I mean type then press Enter
Code:adb devices
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-4.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- If you've set up everything right, the device should get detected under the List of devices attached
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-5.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Run the command below to get the device into Bootloader (fastboot)
Code:adb reboot-bootloader
if that fails
Code:adb shell reboot fastboot
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-6.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- The device should now boot into fastboot (a black or coloured screen with the text fastboot)
- In fastboot, test detection/connection to the device using the command:
Code:fastboot devices
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-7.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- If fastboot is set up right, you should see its ID printed out
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-8.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Now, check the device's Bootloader lock status using either of the two commands below (if it's locked or unlocked)
Code:fastboot oem device-info
fastboot getvar unlocked
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-9.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- If you use the fastboot oem device-info command and the result is false then your bootloader is locked but if the result is true then the bootloader is unlocked
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-14.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- If you use the fastboot getvar unlocked command and the result is no then your bootloader is locked but if the result is yes then the bootloader is unlocked
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-12.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- If you use the fastboot oem device-info command and the result is false then your bootloader is locked but if the result is true then the bootloader is unlocked
- If you've confirmed your bootloader is locked, then run the command below to unlock the Bootloader
Code:fastboot oem unlock
- If that doesn't work then try the commands below:
Code:fastboot oem unlock-go
fastboot flashing unlock
fastboot flash unlocking
fastboot bbk unlock_vivo
Note: Vivo phones require a custom fastboot binary (attached at the end of this post)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-13.webp]](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
- Some devices require you to also run:
Code:fastboot flashing unlock_critical
- You should get a prompt (on the device) asking you to press Volume up to confirm or Volume down to cancel. Press Volume up on the device (for some phones it is actually the opposite; Volume down would confirm while up would cancel or do nothing)
- Once the Bootloader is unlocked, reboot the device using
Code:fastboot reboot
- The device might take a while to boot up (since it is a first boot) so be patient
How to relock Android bootloader using fastboot
It is important to return the device to stock ROM by flashing its factory/stock/official firmware before relocking the bootloader. Relocking the bootloader with a custom partition (TWRP/Custom ROM/GSI) still in place will brick the device.
Depending on the unlock command you used, try its corresponding bootloader relock command:
Code:
fastboot oem lock
fastboot oem lock-go
fastboot flashing lock
fastboot flash locking
fastboot bbk lock_vivoImportant Notice
- This guide isn't guaranteed to work on all (Mediatek, Spreadtrum, Qualcomm, Exynos, Hisilicon, Intel etc) Android devices
- Ensure to backup your important stuff because unlocking your Bootloader wipes your data (/userdata)
- Unlocking the bootloader bricks some devices so ensure to relock or flash the firmware if you find yourself in such a situation
- If you successfully installed ADB / fastboot and your device still isn't detected then it is most likely due to old ADB or drivers, fix it using the guide on fixing ADB and fastboot detection problems
Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-1.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-1.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-2.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-2.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-3.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-3.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-4.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-4.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-5.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-5.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-6.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-6.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-7.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-7.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-8.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-8.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-9.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-9.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-14.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-14.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-12.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-12.webp)
![[Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-13.webp]](https://www.hovatek.com/blog/bpyeki/uploads/2023/11/Hovatek-How-to-unlock-the-Bootloader-of-a-Mediatek-or-Spreadtrum-Android-phone-13.webp)