Android

Installing a Custom ROM on Android: Step-by-Step Guide

This guide details the process of installing a custom ROM on an Android device. You'll learn how to unlock the bootloader, install TWRP, and flash your chosen ROM, gaining full system control.

Updated at February 16, 2026
30-60 min
Medium
FixPedia Team
Применимо к:Android 10+Devices with unlock bootloader support

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:

  1. Device: A supported model with an unlocked bootloader (or the ability to unlock it). Battery charged to at least 80%.
  2. Computer: A PC or laptop with Windows, Linux, or macOS.
  3. 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 .img format 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.
  4. 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.
  5. 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

  1. 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").
  2. 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 device status should appear. If it says unauthorized—check the USB debugging permission on the phone.

Step 2: Unlock Bootloader

⚠️ IMPORTANT: This step will completely wipe all data on the device's internal storage. Ensure your backup is complete.

  1. 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 Fastboot or Bootloader text.
  2. In the PC terminal, check the connection:
    fastboot devices
    
    A line with the serial number should be displayed.
  3. 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>
      
  4. 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.
  5. 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.

  1. Download the latest TWRP image (.img file) for your exact model from the official TWRP website.
  2. Reboot the device into Fastboot mode (if it's not already there).
  3. Flash the TWRP image:
    fastboot flash recovery twrp-3.x.x-x-xxxx.img
    
    Replace twrp-3.x.x-x-xxxx.img with the name of the file you downloaded.
  4. Important note: Many modern devices automatically revert to the stock recovery after reboot. To prevent this:
    • Immediately after flashing, without leaving Fastboot, run:
      fastboot boot twrp-3.x.x-x-xxxx.img
      
      This temporarily boots TWRP without overwriting.
    • Or, if the fastboot boot command is not supported, boot into TWRP, press "Wipe" → "Format Data" (enter yes), then "Reboot" → do not return to the system, but boot into TWRP again (using the button combination). After this, TWRP should persist.
  5. Confirm that you have booted into TWRP. Its interface is a touch menu with buttons.

Step 4: Flashing the Custom ROM via TWRP

  1. 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 Settings menu, check Enable Slide to Modify—this prevents accidental wipes.
  2. 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).
  3. Perform wipe: From the main TWRP menu, press Wipe.
    • Format Data → enter yes → confirm. This erases ALL data.
    • Advanced Wipe → check Dalvik / ART Cache, System, Data, Cache. Do NOT touch Internal Storage (if files are copied there) or Micro SDCard. Swipe to confirm.
  4. 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).
  5. Install GApps (if needed): Immediately after a successful ROM installation (without rebooting!), press "Install again", select the GApps archive, and swipe.
  6. Clear cache: After installing both components (ROM and GApps), from the main TWRP menu press WipeAdvanced Wipe → check only Dalvik / ART Cache and Cache → swipe.

Step 5: First Boot

  1. From the main TWRP menu, press RebootSystem.
  2. The first boot after flashing is the longest. It can take from 5 to 20 minutes. Do not interrupt the process.
  3. After booting, go through the standard Android setup. If you installed GApps, sign in to your Google account.
  4. Return to TWRP and make a full backup! (Backup → select System, Data, Boot, Recovery → swipe). Save the archive to external storage. This is your "safety" image to roll back in case of issues.

Verification

  1. Ensure the device has booted into the new system.
  2. 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.).
  3. Test basic functions: calls, Wi-Fi, Bluetooth, camera, sound.
  4. 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), then Advanced 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.img or using adb sideload).
  • No connection to PC in Fastboot/TWRP: Install correct drivers (for Windows) or use a different USB port/cable. Enable MTP in TWRP.
  • Error FAILED (remote: 'Unknown command') or FAILED (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.img or fastboot 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.

F.A.Q.

Will installing a custom ROM delete all data?
Can I install a custom ROM without unlocking the bootloader?
What is TWRP and why is it needed?
Flashing via Fastboot or TWRP — which is better?

Hints

Prepare device and backup data
Unlock Bootloader
Install Custom Recovery (TWRP)
Flash Custom ROM via TWRP
First Boot and Setup
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community