By | May 16, 2023

TWRP Instead Of AOSP Recovery

This guide will show you how to replace the AOSP Recovery with the TWRP Recovery. In the past couple of years, many custom ROMs have included their own custom recovery. For example, upon flashing LinegeOS, you get the Lineage Recovery, Pixel Experience will give you the Pixel recovery, and so on. There is, however, one major drawback to these recoveries.

Their flashing capabilities are limited to a few handfuls of files. These devices are primarily designed for flashing custom ROMs or updating them via ADB sideload. You might also be able to sideload Magisk with some custom recoveries, but that’s about it. The TWRP Recovery, on the other hand, lets you flash any and all ZIP and even IMG files. Suppose, for instance, you want to root your custom ROM.

In most cases, you’ll need to extract the ROM’s payload.bin and get its boot.img, patch it with Magisk, boot your device using the patched file, and then use Direct Install to gain root access. There are quite a few steps involved in this process, rather than simply flashing Magisk via TWRP and having your ROM rooted. The best option would be to replace the AOSP Recovery with the TWRP Recovery owing to all these benefits. That’s exactly what we’ll show you in this guide.

Advertisements

How to Replace AOSP Recovery [Lineage/Pixel/etc] with TWRP

Just to be safe, please make a backup of all the data on your device before you begin. The following steps will not hold AMS  and its members responsible in case of a thermonuclear war if your alarm doesn’t wake you up, or if anything happens to your device and data.

1: Install Android SDK

Entering Commands in PowerShell Window

To begin with, you will need to download and install the Android SDK Platform Tools on your PC. Google provides the official binary for ADB and Fastboot here, which is the only one that is recommended. So download it and then extract it anywhere on your PC that is convenient for you. The platform tools folder will become available once you have done so, which will be used throughout this guide to replace the AOSP Recovery with TWRP.

2: Enable USB Debugging

You will need to enable USB Debugging and OEM Unlocking on your device next. Your device will be recognizable by the PC when using ADB mode if you use the former.

Advertisements

enable USB debugging

Once you have done so, your device will boot to Fastboot Mode. The OEM Unlocking process is required for bootloader unlocking, however. To enable USB Debugging and OEM Unlock, go to Settings > System > Advanced > Developer Options > Enable USB Debugging and OEM Unlock 7 times.

3: Unlock Bootloader

In addition, you will need to unlock the bootloader of the device. It is important to keep in mind that doing so will wipe off all the data from your device and could also void its warranty. Having said that, you can refer to our detailed guide on How to Unlock the Bootloader on any Android Device if that’s all okay with you.

4: Download TWRP Recovery

  • You may now grab hold of the TWRP Recovery corresponding to your device from the below link:
TWRP OFFICIAL SITE
  • The TWRP IMG file should be renamed to twrp.img after downloading and transferred to the platform tools folder.

5: Boot to Fastboot Mode

  • Now connect the USB cable to your device and the PC. The USB Debugging feature should be enabled.

    Advertisements
  • Enter CMD into the address bar of the platform-tools folder, followed by the platform-tools folder. You will be prompted to launch the Command Prompt.

CMD and press Enter

  • In the command window of CMD, type the following command to boot into Fastboot mode
adb reboot bootloader

reboot-bootloader

  • Enter the following command to verify the Fastboot connection and you should receive the device ID back.
fastboot devices

Identifying your Device in ADB or Fastboot Mode

Advertisements
  • Please install the Fastboot Drivers on your PC if you are not getting any serial ID from the Fastboot process.

6: Temporary Replace AOSP Recovery with TWR

If you intend to use TWRP only once, it is best to temporarily boot your device into TWRP. After the system has booted, the desired file may be flashed and the system may be rebooted. As soon as that occurs, the TWRP will be replaced by using the AOSP Recovery.

  • Go to the platform-tools folder, type CMD in the address bar, and press Enter. Using this method, you will be able to launch the Command Prompt.

CMD and press Enter

  • You may now temporarily boot your device to TWRP Recovery by typing the following command into the CMD window:
fastboot boot twrp.img

  • Now that TWRP has been installed, your device will boot into it. Next, you will need to complete the installation process permanently.

    Advertisements

7: Permanently Replace AOSP Recovery with TWRP

Note that the method to permanently flash TWRP varies depending on your device, so please double-check the instructions from your device-specific forum or ask us in the comments below. Here are two generic methods for installing the recovery, which “usually” work for most devices.

  • The first step is to temporarily boot your device to TWRP, as described above.

  • Then, tap on Advanced and select Flash Current TWRP. The device will now be flashed with the latest version of TWRP.

twrp advance

  • The twrp.img can also be transferred to the device via any of the three methods described.

    Advertisements
  • After that, go to Advanced > Install Recovery Ramdisk > select twrp.img and flash it.

Install Recovery Ramdisk

Once you have flashed TWRP using either of the two methods, select Recovery from the Reboot menu.

Recovery from the Reboot menu

Advertisements

TWRP will be installed on your device after a reboot. In this case, it means that the TWRP recovery has been permanently flashed onto your device.

Now that the device has been flashed, you can select Reboot > System in order to boot the device to the OS after flashing the desired files.

There you have it. The following steps will guide you through the process of replacing the AOSP Recovery with the TWRP Recovery. Let us know if you have any questions regarding the aforementioned steps by leaving a comment below. Please be assured that we will get back to you with a solution at the earliest opportunity.

Leave a Reply

Your email address will not be published. Required fields are marked *