Introduction / Why This Is Needed
Installing a custom ROM is one of the most powerful ways to update or completely change your Android device experience. You gain access to the latest Android versions after the manufacturer has ended support, remove pre-installed bloatware, get additional features and settings, and often improve performance and battery life.
This guide is a universal manual. Specific file names and some steps may vary slightly for your model. Always refer to the official instructions for your specific device and the chosen ROM (e.g., on the LineageOS website).
Requirements / Preparation
Before you begin, ensure all the following conditions are met:
- Device: A supported model with an unlocked bootloader (or the ability to unlock it). Battery charged to at least 80%.
- Computer: A PC or laptop with Windows, Linux, or macOS.
- Software:
- ADB and Fastboot drivers for your OS (often included in the Minimal ADB and Fastboot package or the full SDK Platform-Tools).
- A custom recovery (TWRP) in
.imgformat for your exact model (e.g.,twrp-3.7.0_9-0-honor20s.img). - The archive of your chosen custom ROM (e.g.,
lineage-19.1-20230601-nightly-honor20s-signed.zip). - (Optional) A GApps (Google Apps) archive for the selected Android version.
- Backup: All important data (photos, contacts, messages) must be copied to an external storage or cloud service. The process will wipe everything from internal storage.
- Bootloader Unlock: If you haven't done this yet, the process will start with this step. Carefully review the "Unlock Bootloader" section.
Step-by-Step Guide
Step 1: Device and PC Setup
- On the device:
- Enable Developer Options:
Settings → About phone → Tap 'Build number' 7 times. - In
Settings → Developer options, enable:- OEM unlocking.
- USB debugging.
- Connect the device to the PC and allow USB debugging (a pop-up will appear on the phone—check "Always allow").
- Enable Developer Options:
- On the PC:
- Download and extract the Platform-Tools (from Google) archive to a convenient folder, e.g.,
C:\adb. - Open a terminal (CMD, PowerShell, Terminal) in that folder. Check the connection:
adb devices - A line with your device's serial number and
devicestatus should appear. If it saysunauthorized—check the USB debugging permission on the phone.
- Download and extract the Platform-Tools (from Google) archive to a convenient folder, e.g.,
Step 2: Unlock Bootloader
⚠️ IMPORTANT: This step will completely wipe all data on the device's internal storage. Ensure your backup is complete.
- Reboot the device into Fastboot/Bootloader mode. The method depends on the model:
adb reboot bootloader- Or a button combination (usually: hold Volume Up + Power).
- The screen should show a black window with the manufacturer's logo and
FastbootorBootloadertext.
- In the PC terminal, check the connection:
A line with the serial number should be displayed.fastboot devices - Run the unlock command. The syntax differs!
- For most Xiaomi, OnePlus, Google Pixel, Honor devices:
fastboot flashing unlock - For some older devices (e.g., some Samsung, HTC):
fastboot oem unlock - For Motorola devices: You need to obtain a unique key from the Motorola website and enter:
fastboot oem unlock <your_key>
- For most Xiaomi, OnePlus, Google Pixel, Honor devices:
- A warning will appear on the phone screen with "Yes" and "No" buttons. Use the volume buttons to select "Yes" and press the power button. The device will reboot and perform a factory reset.
- After reboot, set up the device again (or skip), re-enable Developer Options and USB debugging, as in Step 1.
Step 3: Installing Custom Recovery (TWRP)
💡 Tip: TWRP is usually flashed via Fastboot, but for some devices (especially with A/B partitioning), it may need to be flashed via "Recovery" from the bootloader. Check your model's instructions on the official TWRP website.
- Download the latest TWRP image (
.imgfile) for your exact model from the official TWRP website. - Reboot the device into Fastboot mode (if it's not already there).
- Flash the TWRP image:
Replacefastboot flash recovery twrp-3.x.x-x-xxxx.imgtwrp-3.x.x-x-xxxx.imgwith the name of the file you downloaded. - Important note: Many modern devices automatically revert to the stock recovery after reboot. To prevent this:
- Immediately after flashing, without leaving Fastboot, run:
This temporarily boots TWRP without overwriting.fastboot boot twrp-3.x.x-x-xxxx.img - Or, if the
fastboot bootcommand is not supported, boot into TWRP, press "Wipe" → "Format Data" (enteryes), then "Reboot" → do not return to the system, but boot into TWRP again (using the button combination). After this, TWRP should persist.
- Immediately after flashing, without leaving Fastboot, run:
- Confirm that you have booted into TWRP. Its interface is a touch menu with buttons.
Step 4: Flashing the Custom ROM via TWRP
- Initial TWRP setup (important!):
- On first launch, TWRP may prompt for a password for data encryption. If you don't use encryption, simply skip it.
- Tip: In the TWRP
Settingsmenu, checkEnable Slide to Modify—this prevents accidental wipes.
- Copy files: Connect the device to the PC in MTP mode (TWRP has a "Mount" option—enable "MTP"). Or use a USB drive with an OTG adapter. Copy the following two files to internal storage (or SD card):
- The custom ROM archive (
.zip). - (Optional) The GApps archive (
.zip).
- The custom ROM archive (
- Perform wipe: From the main TWRP menu, press Wipe.
Format Data→ enteryes→ confirm. This erases ALL data.Advanced Wipe→ checkDalvik / ART Cache,System,Data,Cache. Do NOT touchInternal Storage(if files are copied there) orMicro SDCard. Swipe to confirm.
- Install the ROM: Return to the main menu, press Install.
- Find and select the ZIP file with the custom ROM.
- Swipe to start installation. Wait for completion (can take 5-10 minutes).
- Install GApps (if needed): Immediately after a successful ROM installation (without rebooting!), press "Install again", select the GApps archive, and swipe.
- Clear cache: After installing both components (ROM and GApps), from the main TWRP menu press Wipe →
Advanced Wipe→ check onlyDalvik / ART CacheandCache→ swipe.
Step 5: First Boot
- From the main TWRP menu, press Reboot →
System. - The first boot after flashing is the longest. It can take from 5 to 20 minutes. Do not interrupt the process.
- After booting, go through the standard Android setup. If you installed GApps, sign in to your Google account.
- Return to TWRP and make a full backup! (
Backup→ selectSystem,Data,Boot,Recovery→ swipe). Save the archive to external storage. This is your "safety" image to roll back in case of issues.
Verification
- Ensure the device has booted into the new system.
- Go to
Settings → About phone. The "Android version" line should show the version you installed (e.g., 13.0). The "Firmware version" line will display the custom ROM name (LineageOS, Pixel Experience, etc.). - Test basic functions: calls, Wi-Fi, Bluetooth, camera, sound.
- If everything works—congratulations, the installation was successful!
Potential Issues
- Device stuck on logo (bootloop): Most often caused by incompatible GApps with the ROM version or model. Boot into TWRP, perform
Wipe Data/Factory Reset(Format Data), thenAdvanced Wipe(System, Data, Cache, Dalvik) and try flashing only the ROM, without GApps. If that helps—find a different GApps package. - TWRP won't flash / stock recovery returns: Issue with A/B partitioning or anti-tamper protection. Try flashing TWRP via Recovery from the bootloader (if that option exists) or use model-specific methods (e.g.,
fastboot update twrp.imgor usingadb sideload). - No connection to PC in Fastboot/TWRP: Install correct drivers (for Windows) or use a different USB port/cable. Enable
MTPin TWRP. - Error
FAILED (remote: 'Unknown command')orFAILED (remote: 'No such partition'): You are trying to flash an image to a non-existent partition or the command is unsupported. Ensure you are using the correct command (fastboot flash boot twrp.imgorfastboot flash recovery twrp.img) for your device. Check the instruction on the TWRP website for your model. - No Google Play Store after flashing: You either didn't install GApps or selected an incompatible package. Boot into TWRP and flash a correct OpenGApps or MindTheGapps package for your architecture (ARM, ARM64) and Android version.
💡 Tip: If you're a beginner, start with ROMs that have an active community (LineageOS, Pixel Experience). Their forums and Wiki are the best source for solving model-specific issues.