Fastboot Flash Recovery
TeamWin Recovery Project, more widely known by its TWRP abbreviation, is the most popular custom recovery solution for Android devices. For the unaware, TWRP replaces the default recovery environment that came with your device, so you can root your device via Magisk, flash custom ROMs and kernels, create full backups, and so on.
Fastboot Flash Recovery
One of the reasons Android modders swear by TWRP is its active development and support for a wide variety of devices, with new devices being added to the official build roster regularly. Thanks to the open-source nature of the project, aftermarket developers can also port TWRP unofficially to many other devices. The internal structure of the custom recovery is quite modular, which is why you can find numerous forks as well as further functionality enhancements such as dual boot mods based on TWRP.
DISCLAIMER: Replacing the stock recovery with TWRP usually needs an unlocked bootloader, which may void the warranty on the device. It may also make the device unstable or if not done properly, may completely brick the device. XDA and the author do not take any responsibility for your device. Install TWRP at your own risk and only if you understand what you are doing!
Since TWRP replaces the stock recovery image of your device, the installation process depends on the target device's partition scheme. Users can easily check it by running the following command in ADB shell or a Terminal Emulator app:
Power users can also flash the custom recovery without using a PC, but the process needs root access. To do so, download the appropriate TWRP image file to your phone, rename it to twrp.img, and place it in the root of the internal storage (/sdcard). Run the following commands via adb shell or a terminal emulator app:
On some rare occasions, your device doesn't feature a standalone recovery partition. Instead, the recovery is part of the boot image. The TWRP maintainers for such devices may repurpose a different partition as the recovery environment. As a result, the aforementioned flashing process might need some tweaking on those devices.
In case of a device having A/B partition scheme, the recovery environment is fused with the boot image. Due to this design, you need to temporarily boot TWRP first and later perform a more permanent installation within the custom recovery environment.
The last step is to verify that the custom recovery is working properly. Use the device-specific key-combo or the adb reboot recovery command on an already running device to boot to the recovery mode. If you can see the menu like the one shown below, it means you have successfully install TWRP. Great job!
Lastly, be sure to download the official app for the custom recovery project from Google Play. The app will alert you when new versions of the custom recovery are available. It'll also let you download the latest version right from your device, provided you've root access.
This is the first option you see as soon as you're in TWRP and is probably the main reason you even installed a custom recovery. The main purpose of a custom recovery like TWRP is to flash zip files or img files. This can be a custom ROM, a tweak, a custom kernel, or a package like Magisk to root your device. Selecting this option will show you the list of files and folders on your phone's storage.
You can select the zip file that you want to flash from here and install it. If you wish to install an img file like a kernel or a different recovery, select the Install Image option at the bottom right. You can even switch between multiple storage options like your phone's internal memory, an external SD card, or even a USB drive connected via OTG, based on where your file is stored.
It's always a good idea to take a full backup of your phone via TWRP before modifying something. You can even backup your EFS partition from here which has saved me several times when I lost my IMEI after flashing a new ROM a few years back. You can choose to take a backup into your internal storage, an external SD card, or a USB drive via the Select Storage option.
For example, If you mount the Data partition, you will be able to view and make changes to the files stored on your device. If you unmount the Data partition, TWRP won't be able to access your storage. If you've connected an external USB drive via OTG to flash files or take a backup/restore it, you will first have to mount it via this section by selecting the USB-OTG option. You can also enable/disable MTP from here. if MTP is enabled, you can access your phone's internal storage while in TWRP itself when it's connected to a PC.
You also have two other options. The first one is to reboot back into recovery, and the second one is to reboot into the bootloader which essentially puts your phone in fastboot mode. This is helpful if you want to flash something via fastboot on your PC.
Bootloader / Fastboot mode allows you to flash any partition on a device, be it system, boot, recovery, cache or any other. And not just the partition images from OEMs, you can also flash the custom-built .img files via fastboot. For example, a custom recovery like TWRP.
For the unknown, TWRP recovery is a custom recovery for Android devices developed and maintained by the folks at TeamWin. It lets you do a host of things on your Android phone that neither Google nor your device manufacturer built support for. For example, a full device (nandroid) backup. Using TWRP recovery you can take a full backup of your Android phone, which you can restore to even repair a soft-bricked device.
Since not all Android devices are same, TWRP is built differently for each. Also, you might find the recovery available as both official and unofficial builds, on the internet. This is because TWRP recovery is an open source project and anyone with knowledge can compile a TWRP recovery build for any Android device.
My devices currently on bootloop state with no single recovery installedI still can boot into fastboot modeBut it says the FRP is LockedWhen im trying to flash the twrp.img it show an errorFAILED (remote: necessary to unlock FRP!)Can you help me fix this?
If your device has boot ramdisk, get a copy of the boot.img (or init_boot.img if exists).If your device does NOT have boot ramdisk, get a copy of the recovery.img.You should be able to extract the file you need from official firmware packages or your custom ROM zip.
The easiest way to uninstall Magisk is directly through the Magisk app. If you insist on using custom recoveries, rename the Magisk APK to uninstall.zip and flash it like any other ordinary flashable zip.
In the case when your device does not have ramdisk in boot images, Magisk has no choice but to hijack the recovery partition. For these devices, you will have to reboot to recovery every time you want Magisk enabled.
When Magisk hijacks the recovery, there is a special mechanism to allow you to actually boot into recovery mode. Each device model has its own key combo to boot into recovery, as an example for Galaxy S10 it is (Power + Bixby + Volume Up). A quick search online should easily get you this info. As soon as you press the key combo and the device vibrates with a splash screen, release all buttons to boot into Magisk. If you decide to boot into the actual recovery mode, long press volume up until you see the recovery screen.
After successfully unlocking the bootloader of my new Nexus 4 using adb and fastboot I now want to install ClockworkMod Recovery onto my device.Sadly it is not working properly. I am using Gnome Ubuntu 13.04 and installed adb and fastboot with apt.While in fastboot mode my device is visible when testing with
it gets stuck. I already waited for 40 minutes to complete but since the size of the image is around 8Mb I suppose it cannot take that much time and something is not working correctly.Strangely also my USB-connected keyboard and Bluetooth-connected mouse are ignoring my inputs while fastboot is running.
My Nexus 10 stopped booting. It shows an open padlock on startup and the Google text in the middle. So I figured my son unlocked the bootloader somehow after creatively following instructions he found on youtube.I then tried to proceed to installing a fresh rom. Saw that CM has the "Manta" roms.I have handy the main rom: cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J6-manta.zip.I found two recovery roms: twrp-184.108.40.206-manta.img and cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J6-manta-recovery.img.I'm able to get fastboot to see my device, after doing the vol up+down / power thing. But then the command fastboot -w flash recovery cm-13.0-20160820-SNAPSHOT-ZNH5YAO0J6-manta-recovery.img never completes.
That never finishes. The tablet shows, aside from the laying down Android picture and the info, a blue line: "FASTBOOT STATUS - flash:recovery". It never gets past this.I tried this with both the recovery img files I found.Anyone have any idea why my Nexus 10 can't seem to complete this fastboot recovery installation? I'm doing this using Xubuntu 15.04 btw, and I don't have Windows handy. I seriously hope it isn't a Linux limitation thing. adb has always worked great. Fastboot sees and interacts with the device, so, that part should be good I hope.
You need a PC for this. If you do not have a PC, or access to a PC, then you are stuck!Note - these instructions are mainly for A-only devices:Note 2 - do NOT EVER use fastboot to flash a zip file:
Also, the user must have the Android Composite ADB Interface already installed before proceeding with the fastboot flashing instructions. This is because the adb command is used to switch the device into fastboot mode.
In this tutorial, we will make you aware which device should use fastboot flash recovery twrp.img and which should use the fastboot boot twrp.img command. Furthermore, we will also let you know the reason why two different commands exist in the first place. Moreover, the doubts surrounding why some devices only have the TWRP image file (twrp.img) whereas others have both the TWRP Installer ZIP (twrp.zip) and TWRP image file (twrp.img) files will also be cleared. 350c69d7ab