This article and video will show you how to install TWRP to your unlocked Android phone so you can run many custom tasks.

This video will show you the steps to customize the phone.

While I have had a lot of success flashing phones, there is a chance of breaking a phone by installing custom software. I cannot be held liable for anything that happens to your device.

Here is the phone I am using here:

Nexus 5X (LGH790)

You will need ADB (Android Debug Bridge) installed on your computer. On Linux they will be in the repos for your distro, or you can get for Windows / Mac / Linux here:
https://developer.android.com/studio/releases/platform-tools.html

You will need device drivers for your phone if you are on Windows. Mac and Linux they should be in the kernel and you should not need them.

TWRP can be downloaded here:

https://twrp.me/

Here are the steps:

Preparing Device

Access settings on the phone, go to:

System --> About Phone --> Press Build Number 7 times to enable developer options.

 

Go to System --> Developer Options and enable USB Debugging and enable OEM Unlocking
Set the USB options to Transfer Files (This is needed for USB Debugging to work)

Terminal / Commandline:

 

adb reboot bootloader

(This step just tells the phone to restart with the bootloader instead of the OS. This can also be accomplished by powering down the phone and turning it on while holding the volume down button)

 

fastboot flashing unlock

(I used sudo fastbook flashing unlock because fastboot is not setup in my permissions for my computer, this is saves me from doing that because this is a rare task for me; the command allows you to confirm unlocking the bootloader so the TWRP can be flashed; use the volume switches to highlight the selection and the power button to select it)

 

fastboot flash recovery twrp-file-version

(Sudo if needed, be sure your terminal is in the directory with the twrp you are flashing, replace 'twrp-file-version' with your exact file name)

Make sure that the first time you reboot the phone after the recovery flash you boot into the recovery partition other wise, most phones will overwrite the custom recovery with the stock recovery.