keepcalculator

06 Numbers and Powers

Install TWRP Recovery on Huawei P9: Full Guide

Card No. 06·4677 · Updated · Standard formula, shown below

To install TWRP (Team Win Recovery Project) on a Huawei P9, you must first unlock the bootloader, then flash the TWRP image using fastboot. This guide covers the entire process, including prerequisites, step-by-step instructions, and how to handle common issues like Huawei’s bootloader unlock restrictions.

Background: Why TWRP Matters for the Huawei P9

The Huawei P9 (model EVA-L09, EVA-L19, EVA-L29, etc.) shipped with Android 6.0 Marshmallow and later received updates to Android 7.0 and 8.0. The stock recovery is limited—it only installs official OTA updates and performs factory resets. TWRP is a custom recovery that replaces the stock one, giving you the ability to:

  • Flash custom ROMs (like LineageOS or AOSP-based builds)
  • Create full system backups (Nandroid backups)
  • Install root packages (like Magisk) or other ZIP files
  • Wipe partitions individually (cache, dalvik, data, system)

Because the P9 is no longer officially supported by Huawei for major Android updates, many users turn to TWRP to keep the device alive with newer custom ROMs.

Prerequisites: What You Need Before Starting

Before you begin, gather the following:

  • A Windows, macOS, or Linux computer
  • A USB cable that supports data transfer (not just charging)
  • The Huawei P9 with at least 50% battery
  • Huawei USB drivers installed on your computer
  • ADB and Fastboot tools (platform-tools from Google)
  • The TWRP image file for the P9 (twrp-3.x.x-x-eva.img)
  • An unlocked bootloader (see next section)

Make sure to back up any important data on the phone because the process will wipe the device.

Unlocking the Bootloader: The Biggest Hurdle

Huawei officially stopped providing bootloader unlock codes in 2018, citing security concerns. This means you cannot get an official unlock code from Huawei’s website anymore. However, there are still ways to unlock the bootloader on a P9:

  • If your device was previously unlocked, it stays unlocked even after factory resets.
  • Some third-party services (paid) can generate unlock codes based on your device’s IMEI and serial number. Use them at your own risk.
  • On some older builds, a known exploit (like the DC-Unlocker tool) could unlock the bootloader without a code, but this may not work on all firmware versions.

Without an unlocked bootloader, you cannot flash TWRP. The fastboot command will fail with an error like FAILED (remote: Command not allowed).

Step-by-Step: Installing TWRP via Fastboot

Once your bootloader is unlocked, follow these steps:

  1. Enable Developer Options on your phone: Go to Settings > About phone and tap Build number seven times.
  2. In Developer options, enable USB debugging and OEM unlocking (if available).
  3. Connect your P9 to the computer via USB. Run adb devices in a command prompt to verify the phone is detected.
  4. Reboot into fastboot mode by running adb reboot bootloader.
  5. Once in fastboot, verify the connection with fastboot devices. You should see your device ID.
  6. Flash TWRP with the command: fastboot flash recovery twrp-eva.img (replace with the actual filename).
  7. After flashing, do not let the phone boot normally yet. Use the volume keys to navigate to Recovery mode and select it with the power button. The phone will boot into TWRP.

If you boot into the system before entering recovery, the stock recovery might overwrite TWRP. To avoid this, immediately boot into recovery after flashing.

Common Problems and How to Fix Them

Several issues can arise during the process:

  • Fastboot not recognizing the device: Install the correct Huawei USB drivers or try a different USB port/cable. On Windows, right-click the device in Device Manager and update the driver manually.
  • Bootloader locked error: If you get remote: Command not allowed, your bootloader is still locked. You must unlock it first.
  • Stuck at Huawei logo: This usually happens if you boot to system without flashing TWRP correctly. Force restart by holding power + volume down for 10 seconds, then try again.
  • TWRP not sticking: Some firmware versions have a recovery-in-boot feature. You can try flashing TWRP to the recovery_ramdisk partition instead: fastboot flash recovery_ramdisk twrp-eva.img.
  • Data encryption: If TWRP asks for a password to decrypt data, it’s because the phone uses file-based encryption. You can wipe data in TWRP (this erases all data) or enter your lock screen PIN/password.

After Installation: What to Do Next

Once TWRP is running, you should:

  • Make a full backup (Nandroid) before making any changes. Go to Backup and select all partitions.
  • If you want root, download the Magisk ZIP and flash it via TWRP.
  • If you plan to install a custom ROM, download the ROM and GApps (Google Apps) ZIPs, then perform a factory reset in TWRP (wipe data, cache, dalvik) before flashing.
  • Be aware that TWRP may not support all P9 variants perfectly; some models have different partition layouts. Always download the correct TWRP build for your specific model.

Alternatives to TWRP

If you cannot unlock the bootloader or prefer a simpler solution, consider:

  • Stock recovery: For official updates only, no custom ROMs.
  • Magisk patched boot image: You can root without TWRP by patching the boot image with Magisk and flashing it via fastboot.
  • Fastboot boot command: You can temporarily boot TWRP without flashing it: fastboot boot twrp-eva.img. This is useful for one-time operations but does not persist.

Frequently Asked Questions

Is it safe to install TWRP on my Huawei P9?

It is generally safe if you follow instructions carefully. However, there is always a risk of bricking if you flash an incompatible image or interrupt the process. Always use the correct TWRP build for your exact model.

Will installing TWRP void my warranty?

Yes, unlocking the bootloader and flashing custom recovery voids the warranty. Huawei will not cover any damage caused by modifications.

Can I uninstall TWRP later?

Yes, you can restore the stock recovery by flashing the original recovery image from Huawei’s firmware package. You can also relock the bootloader, but that may wipe your data.

Why does TWRP ask for a password?

This is due to Android’s encryption. If you set a PIN or password on your phone, TWRP will ask for it to decrypt the data partition. If you forgot it, you must wipe data from TWRP, which erases all files.

Does TWRP work on all Huawei P9 models?

Most P9 variants (EVA-L09, L19, L29) are supported by the same TWRP image. However, some carrier-specific models may have different hardware. Always check the XDA Developers forum for your exact model.

What if I get a ‘failed to mount’ error in TWRP?

This often happens after a bad wipe or when the partition is corrupted. You can try formatting the partition (e.g., format data) in TWRP, or restore from a backup if you have one.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →