Source
-
Install ADB, Fastboot and Android USB drivers (if necessary) on a PC
-
Download TWRP Recovery from https://dl.twrp.me
-
Unlock the bootloader on the device
-
Enable Developer Mode
- Got to Settings > About Phone
- Tap the Build Number multiple times until a toast or popup shows up, saying you’re now a developer
-
Go to Developer Settings now and enable OEM Unlocking
-
Connect the phone to a PC via USB
-
If the phone runs Android 5.1 or lower run
fastboot oem unlock
for Android 6.0 or higher
fastboot flashing unlock
-
Use the volume buttons to move around in the menu on the phone screen and highlight Yes, then press the power button to confirm
-
-
Power off the phone
-
Boot into the bootloader (press volume up and the power button simultaneously until the bootloader menu shows up; could also be another combo)
-
Connect the phone to a PC via USB again
-
Flash the downloaded TWRP Recovery image (replace
twrp.img
with the actual file name)fastboot flash recovery twrp.img
-
Once the flashing is done, reboot
fastboot reboot