Introduction / Why This Is Needed
TWRP (Team Win Recovery Project) is an open-source custom recovery environment for Android devices. Unlike the standard stock recovery, TWRP provides a full touchscreen interface that allows you to:
- Install custom ROMs and modified system images.
- Gain root access (e.g., via Magisk).
- Create full or selective backups of system partitions (including system, data, bootloader) and restore them.
- Format and wipe partitions for a clean start.
Installing TWRP is the first and crucial step toward deep customization of your Android device. This guide will walk you through the entire process: from preparation to the first boot.
Requirements / Preparation
Before you begin, ensure all conditions are met. Failure to comply with any of these points may lead to a soft-brick or prevent installation.
- Supported Device. TWRP officially supports hundreds of models. Check if your model is listed on the official TWRP website. Download the exact image for your specific model and regional variant (e.g.,
twrp-3.7.0_9-0-herolte.imgfor Samsung Galaxy S7). - Unlocked Bootloader. This is a mandatory requirement. The unlocking process is unique for each manufacturer (Xiaomi, Samsung, OnePlus, etc.) and often requires an official unlock code request from the manufacturer. Unlocking typically completely wipes all data on the device.
- On your PC (Windows/Linux/macOS):
- Installed ADB (Android Debug Bridge) and Fastboot. These are part of the Android SDK Platform-Tools. Download them from the official Android developer page and extract to a convenient folder (e.g.,
C:\platform-tools). - USB drivers for your device (especially relevant for Windows). Install OEM drivers or use universal ADB drivers.
- Installed ADB (Android Debug Bridge) and Fastboot. These are part of the Android SDK Platform-Tools. Download them from the official Android developer page and extract to a convenient folder (e.g.,
- On the device:
- Enabled USB Debugging (
Settings → About phone → Build number— tap 7 times, thenSettings → Developer options → USB debugging). - Enabled OEM Unlocking in
Developer options. On some devices (Xiaomi), you may also need to bind your account. - Fully charged battery (at least 80%).
- WARNING: The process carries a minimal but existing risk. Back up all important data from the device to an external storage or cloud service.
- Enabled USB Debugging (
Step 1: Prepare Files and Connect
- Place the downloaded TWRP image file (e.g.,
twrp.img) into the folder whereadb.exeandfastboot.exeare located (e.g.,C:\platform-tools). This eliminates the need to specify the full file path in commands. - Connect the device to the computer via a USB cable (original or high-quality cable recommended).
- Open Command Prompt (CMD) or PowerShell in Windows, or a terminal in Linux/macOS in this
platform-toolsfolder. For a quick way to open it: holdShift, right-click on an empty spot in the folder, and select "Open PowerShell window here" or "Open command window here". - Verify that the computer sees the device in debugging mode:
You should see your device's serial number and the statusadb devicesdevice. If the status isunauthorized, a debugging permission prompt will appear on the phone screen — grant it.
Step 2: Reboot to Fastboot/Bootloader Mode
TWRP is flashed via the bootloader mode (Fastboot). Switch the device to this mode:
adb reboot bootloader
If the command doesn't work, you can do it manually: power off the device and hold the key combination (usually Volume Down + Power, but it can vary — check for your specific model).
The device will reboot and show a black screen with text (e.g., FASTBOOT or Downloading...). This is normal.
Step 3: Check Connection in Fastboot
In this mode, the device communicates with the PC via the Fastboot protocol. Check the connection:
fastboot devices
If you see the device's serial number, everything is fine. If the command outputs nothing or says no devices, there's a driver issue (Windows) or a cable problem. Ensure Fastboot drivers are installed and try a different USB port or cable.
Step 4: Flash TWRP
Now for the main part — flashing. In the same open command line, execute:
fastboot flash recovery twrp.img
Replace twrp.img with the exact name of the file you downloaded (e.g., twrp-3.7.0_9-0-herolte.img).
What happens:
flash recoveryis the Fastboot command that flashes the specified image into therecoverypartition.- The system will report data transfer completion (
sending 'recovery'...andOKAY).
Critically important: After a successful flash, do not let the system boot into Android. Immediately execute the reboot command into the newly flashed TWRP:
fastboot reboot recovery
This ensures the device boots into TWRP, not the stock recovery (which could overwrite your TWRP on first boot).
Step 5: First Boot and TWRP Setup
- The device will reboot. Instead of the manufacturer's logo, you will see the TWRP interface (menu with icons).
- On first launch, TWRP will likely prompt you for:
- Password/Decryption reset: If your system was encrypted, TWRP will ask for the password to decrypt data.
- Google Apps (GApps) installation: Usually not needed immediately. Select "Do not install".
- Data wipe (Wipe): Do NOT perform a full wipe (
Format Data) here if you want to keep your current system. Make a backup first.
- Recommended first action: Make a full backup of the current stock system. In the TWRP menu, select
Backup, check the partitionsSystem,Data,Boot(if needed), and swipe to start the backup. Save the archive to an external SD card or device storage. - After the backup, you can install Magisk for root, a custom ROM, or simply exit TWRP by selecting
Reboot → System.
Verification of Success
Successful installation is confirmed by:
- The device booting into the TWRP interface (menu with buttons like "Install", "Wipe", "Backup", etc.).
- The presence of a file named
recovery-from-boot.pin the root of internal storage (this file is created by TWRP upon successful flashing and prevents overwriting by stock recovery). - The ability to create partition backups without errors.
Potential Issues and Solutions
| Problem | Possible Cause | Solution |
|---|---|---|
fastboot: command not found or adb is not recognized... | ADB/Fastboot not added to PATH or not installed. | Ensure you are in the platform-tools folder when running commands, or add this folder to the system PATH variable. |
fastboot devices does not see the device | Incorrect drivers (Windows), faulty cable, device not in Fastboot. | Reinstall Fastboot drivers. Try a different USB port (USB 2.0 preferred) and cable. Confirm the device is actually in Fastboot mode (the screen should show a relevant message). |
FAILED (remote: device is locked) or OEM unlock is not allowed | Bootloader is not unlocked. | Return to the bootloader unlocking step for your specific device model. On Xiaomi, account binding and waiting may be required. |
verification failed or Installation aborted when trying to flash TWRP | Issue with the integrity of the TWRP image file. | Re-download the image from the official site. Check the checksum (MD5/SHA256) if provided. Ensure the file is not corrupted. |
| Device boots into stock recovery, not TWRP | After flashing, a normal reboot (fastboot reboot) was performed instead of fastboot reboot recovery. | Enter Fastboot again and run fastboot reboot recovery. If that doesn't work, re-flash TWRP, double-checking the filename. |
| Bootloop on logo after installation | Incompatible TWRP version or corrupted system partitions. | Boot into TWRP (if possible) and restore the backup made in Step 5. If not, try flashing a different TWRP version (e.g., an older version or a nightly build) for your model. |