TWRP is a popular open-source custom recovery software available for many Android devices. If you want to install custom Android ROM (e.g. CyanogenMod now LineageOS, Resurrection Remix, Bliss OS, etc) in your Android devices you need to have a custom recovery software installed on it. This post is talking about how to install TWRP Recovery Nexus 5.
This post is written and tested using Nexus 5 (Hammerhead), but the methods should work on most of other Android devices.
Follow the steps below to install TWRP Recovery on Nexus 5
Download TWRP recovery image for Nexus 5
Go to this page https://twrp.me/devices/lgnexus5.html to download the recovery image for Nexus 5. At the time of this writing, its version is TWRP 3.0.2-0
Enable USB Debugging
To enable USB Debugging on Nexus 5, go to Settings > Developer Options. Turn on USB Debugging under Debugging section.
Install Android ADB / Fastboot tools
In Mac OS X you can install ADB / Fastboot tools by running command below:
brew install android-platform-tools
In Fedora / Centos :
sudo yum install android-tools
In Debian / Ubuntu / LinuxMint / ElementaryOS:
sudo apt-get install android-tools-adb android-tools-fastboot
In Windows, you can follow my previous post in this post.
Connect the Nexus 5 to computer / laptop using USB cable data
We need to connect Nexus 5 to a computer / laptop using USB cable data to execute commands below.
Flash the TWRP into Nexus 5
Open Terminal (in Mac OS, Linux) or Command Prompt (in Windows). First reboot it into bootloader.
adb reboot bootloader
When executing the above command, you may be prompted to allow USB Debugging. Tap OK to allow it then re-run the command above to reboot into bootloader. Make sure that the LOCK STATE is unlocked, if it is locked you need to unlocked it first. Follow the my previous post how to unlock it here.
Now using fastboot tool, flash the TWRP into the device:
fastboot flash recovery twrp-3.0.2-0-hammerhead.img
After flashing the TWRP recovery using the command above, I run command ‘fastboot reboot‘ but it does not work. Instead use Volume UP/Down to select Recovery Mode then press Power Button to reboot into TWRP Recovery.
Once you press the power button, it should reboot into TWRP recovery.