If you are a beginner to these things like the TWRP or fastboot then I will tell you in simple words that the fasboot is a utility provided by Google to deal with fastboot ot bootloader mode on an Android device. Android has many partitions as a complete System, such as: Boot partition, Recovery partition, System partition, Cache partition, Userdata partition etc. Basically this fastboot mode is used to update these partitions manually. Here we are going to use fastboot to flash the TWRP Custom Recovery on an Android phone or tablet. Basically TWRP is a customized Android recovery available for many but not all Android devices.
Installing TWRP custom recovery may require your Android’s bootloader to be unlocked and may VOID your warranty and may delete all your data. Before proceeding further you may consider backup your all data. You are the only person doing changes to your phone and I cannot be held responsible for the mistakes done by you. Neither the developer nor we can be held responsible for any disaster that happens to your device.
Whats to be prepared:
Unlocked bootloader on your Android. Here is a Bootloader unlock guide which may help for your device.
ADB and Fastboot installed on your PC or MAC.
TWRP image for your device. Get officiall TWRP image here.
Enough battery backup. (More than 60% of battery charge will be good enough)
A PC with USB driver installed for your Android.
If you have those preparedalready, then this guide will help you.
Guide to Install TWRP as Custom Recovery for Android Device
Download the TWRP recovery image to be installed on your Android. Make sure that the TWRP recovery is specifically for your Android device.
Enable USB Debugging under Developer Options.
Install ADB and Fastboot utility on your PC or MAC. Follow the appropriate guide to install Fastboot according to the OS that you use
Go to the directory where you have downloaded the TWRP image file and then open the command console or termianl on this directory on your PC. To open a command window on Windows OS in the current directory, press shift + Right Click anywhere on Windows explorer, or some folder. Then on the menu opened, just press the “w” key on the keyboard or select “Open command window here” to open a command window.
Now connect your Android to the PC using a USB cable.
Enter the following command on the command window opened:
to put your Android into bootloader mode where you can flash/install the TWRP recovery.
adb reboot bootloader
If your Android device asks permission such as “Allow USB debugging” then just tap on OK to proceed.
Now when your Android is on the bootloader mode just execute the following command on the console:
While executing this command make sure to replace the twrp-3.0.x.x-xxx.img with the actual file name of the TWRP that you have downloaded for your Android.
fastboot flash recovery twrp-3.0.x.x-xxx.img
Wait for the TWRP to be flashed. Once it is done execute the following command:
on the command console and booom!!...
After executing all above steps in order, your Android will have the TWRP installed. Your Android is now installed with TWRP recovery, Congrats!