Unlock Bootloader and Flash TWRP in Sony Xperia XZ

Complete tutorial to flash Unlock bootloader and flash TWRP recovery img for your Sony Xperia XZ to install Custom ROM.

Unlocking the bootloader of your Xperia will help you flash custom ROMs and kernels on your device. Sony Xperia XZ launched in 2016 comes with Qualcomm MSM8996 Snapdragon 820 running on Quad-core (2×2.15 GHz Kryo & 2×1.6 GHz Kryo) with dual SIM support, 3G RAM and running on Android Nougat 7.0

If you wish to unlock bootloader and install any Custom ROM for your Sony Xperia XZ then today I have a provided complete tutorial for the same. Before we proceed forward,

 Check whether your device bootloader is unlockable or not –

  1. In your device, open the dialler and enter *#*#7378423#*#*
  2. Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can unlock the device boot loader. If it says No, or if the status is missing, sorry but your device cannot be unlocked.

Prerequisites:

  • Take the complete backup of your device data
  • Keep battery percentage up to 50%
  • Use original USB cable

Get unlock code from Sony

For following two methods you need unlock key/code provided by Sony. This code helps in unlocking the bootloader.

  • Visit the website of Sony Xperia, there you will be asked to select your device for unlocking boot loader. Select Sony Xperia XZ (For both single and dual SIM variants) and tap continue.
  • Enter your E-mail, you will be sent a link. Open the link and enter your device IMEI number. (To get the IMEI number, dial *#06# on dialler). keep a note of the IMEI number for future references.
  • Follow the instructions provided to get your unlock code. Keep it written somewhere.

Enable USB Debugging

  • Open Settings> About Phone>  Tap seven times on “Build number” to enable Developer options.
  • In developers, option Turn on USB debugging and OEM unlock
  • Check always if asked
  • In devices running on 4.3 or below the option is available under settings

Unlock Bootloader of Xperia XZ with ADB and Drivers

Note: These is an official and more reliable method. Perform operation on your own risk. Compatible with all smartphones.

  1.  Download and install the Minimal ADB and Fastboot drivers on your PC.
  2. Also, download and save the USB drivers in the same folder as for above.
  3. Enable OEM unlock and USB Debugging in your Z5 under Developers option in settings. (see last)
  4. Boot your device into fastboot mode by powering it off and then holding volume up button.
  5. When a blue light tings up connect your device to PC using original USB cable.
  6. Now open the command prompt window in the folder where you saved ADB and Fastboot files by using shift and Right Click.
  7. In command prompt enter code fastboot devices and hit enter
       fastboot devices
  8. Now enter the command code fastboot -i 0x0fce oem unlock 0x(unlock key from sony)
       fastboot -i 0x0fce oem unlock 0x01A2435BG6548
  9. The coloured portion above is the unlock code/key which is provided by sony. Replace unlock code with the one you got earlier.
  10. Your bootloader will be unlocked successfully

You can check whether bootloader is unlocked or not –

  1. In your device, open the dialler and enter *#*#7378423#*#* to access the service menu.
  2. Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then bootloader unlocking is successful. If it says No, or if the status is missing, your device is not unlocked.

Flash TWRP in Sony Xperia XZ

  1. Download the TWRP file in the same directory where you have extracted Fastboot/ADB package files. (Rename TWRP file name twrp.img)
  2. Again go into Fastboot/Bootloader Mode on Sony Xperia XZ
  3. Open Command Prompt
  4. In command prompt enter code fastboot devices and hit enter
         fastboot devices
  5. Now flash twrp.img by using fastboot command fastboot flash recovery twrp.img
         fastboot flash recovery twrp.img
  6. Now reboot the device with command fastboot reboot
         fastboot reboot
  7. TWRP is installed in your device.
    Flash TWRP (representational image)

    Flash TWRP Recovery (representational image)

  8. Enter in recovery mode  for first time before you flash a custom ROM. (Do not flash any ROM for first time recovery reboot)

Note & Conclusion:  ***DigitBin is not liable for any damage caused. Perform the operation on your own risk. You will void your device warranty

I hope the post was helpful in unlocking your Xperia boot loader.

If you've any thoughts on Unlock Bootloader and Flash TWRP in Sony Xperia XZ, then feel free to drop in below comment box. Also, please subscribe to our DigitBin YouTube channel for videos tutorials. Cheers!

Share
Nikhil Azza
Nikhil is a Tech Blogger who sometimes loves to write real-life lore. He has been writing content for the past 8 years, with over 1K+ articles written on Android, Mac, iOS, Social Media, Cloud Storage, Software, and General Tech. Know More

Leave a Reply

Your email address will not be published. Required fields are marked *