Stock Android recoveries are limited to flashing official OTA updates and performing a factory reset. A custom recovery such as TWRP (Team Win Recovery Project) adds powerful features:
Because TWRP runs outside the Android OS, it can modify partitions that the stock recovery cannot. However, flashing a custom recovery also carries risk: an incorrect image or a power loss can brick the device. The tutorial below explains how to minimise those risks.
Gather the following items and perform the checks listed. Skipping any of these steps can lead to a failed flash or data loss.
Pixel 4a (G025J) or Samsung Galaxy S10e (beyond1)). Check the official TWRP device list for a matching build.Fastboot can only flash images to a device with an unlocked bootloader. Unlocking wipes user data on most OEMs.
Build number seven times.adb reboot bootloader
fastboot flashing unlock
Confirm the on‑screen prompt.
Download the platform‑tools package from the Android developer site and extract it to a convenient folder. Add that folder to your system PATH or run commands from within the folder.
Ensure the battery is at least 70 % or keep the device plugged into power during the entire process.
From the official TWRP page for your device, download the .img file (e.g., twrp-3.6.0_10-0-g950f.img). Save it to the same directory as your platform‑tools.
Follow these steps exactly in the order presented. If a step fails, stop and consult the troubleshooting section.
With the phone in fastboot mode (you should see a screen with the Android robot and the word “FASTBOOT”), run:
fastboot devices
If your device’s serial number appears, the connection is good. If not, try a different USB cable, a USB‑2.0 port, and ensure drivers are installed (Google USB Driver for Windows, android-tools for Linux/macOS).
Execute the following command, replacing twrp.img with the exact filename you downloaded:
fastboot flash recovery twrp.img
Fastboot will report progress and finish with “OKAY”. If you see “FAILED (remote: …)”, note the error message – it often indicates a mismatched image or a locked bootloader.
Immediately after flashing, boot into the newly installed recovery before the system overwrites it with the stock image:
fastboot boot twrp.img
If the device boots into Android instead, use the hardware button combination (usually Volume Up + Power) to manually enter recovery mode.
You should see the TWRP UI with a colorful background, navigation bar, and options such as “Install”, “Backup”, and “Wipe”. Take a screenshot (Power + Volume Down) to confirm.
If you wish to re‑lock the bootloader after confirming TWRP works, reboot to fastboot again:
adb reboot bootloader
Then run:
fastboot flashing lock
Note: Some devices refuse to lock the bootloader while a custom recovery is present. In that case, you can either keep the bootloader unlocked or flash the stock recovery before locking.
Do not power off the device while flashing. A power loss can corrupt the recovery partition, leaving the device unbootable.
sudo cp android.rules /etc/udev/rules.d/).fastboot flashing unlock_critical (use with caution).fastboot boot twrp.img before the OS starts.fastboot flash bootloader with a custom boot image that preserves TWRP.system, data, cache).If you encounter OTA update failures, or you intend to sell the device, restore the stock recovery and relock the bootloader. The steps are the reverse of the tutorial:
.img from the OEM’s firmware package.fastboot flash recovery stock_recovery.img.fastboot flashing lock (if supported).After flashing stock recovery, perform a factory reset to ensure the device boots cleanly.
Flashing TWRP via Fastboot gives you a powerful recovery environment that unlocks the full potential of your Android device. By following the preparation checklist, using the exact commands, and verifying each step, you minimise the risk of bricking your phone. Once TWRP is installed, you can safely create full backups, experiment with custom ROMs, and keep a safety net for future updates.
Remember: the most reliable recovery is the one you keep backed up. Store the .img file and a recent Nandroid backup in a cloud folder or on a PC. If anything goes wrong, you’ll have a clear path to restore your device to a working state.









