Install custom Android OS on lavender

keyboard_arrow_left Back to the overview

Basic requirements

  1. Make sure your computer has adb and fastboot. Setup instructions can be found here.
  2. Enable USB debugging on your device.

Unlocking the bootloader

  1. Create a Mi account on Xiaomi’s website.
  2. Add a phone number to your Mi account.
  3. Insert a SIM into your phone.
  4. Enable developer options in Settings > About Phone by repeatedly tapping MIUI Version.
  5. Link the device to your Mi account in Settings > Additional settings > Developer options > Mi Unlock status.
  6. Download the Mi Unlock app (Windows is required to run the app).
  7. Run the Mi Unlock app and follow the instructions provided by the app.
  8. After device and Mi account are successfully verified, the bootloader should be unlocked.
  9. Since the device resets completely, you will need to re-enable USB debugging to continue.

Installing a custom recovery using fastboot

  1. Download a custom recovery - you can download TWRP. Simply download the latest recovery file, named something like twrp-x.x.x-x-lavender.img.
  2. Connect your device to your PC via USB.
  3. On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:
    adb reboot bootloader
    

    You can also boot into fastboot mode via a key combination:

    • With the device powered off, hold Volume Down + Power. Keep holding both buttons until the word “FASTBOOT” appears on the screen, then release.
  4. Once the device is in fastboot mode, verify your PC finds it by typing:
    fastboot devices
    
  5. Flash recovery onto your device:
    fastboot flash recovery <recovery_filename>.img
    
  6. Now reboot into recovery to verify the installation:
    • With the device powered off, hold Volume Up + Power. Keep holding both buttons until the “Redmi” logo appears on the screen, then release.

    Alternatively, on some devices and recoveries you can use fastboot to boot directly into the freshly flashed or any other desired recovery:

    fastboot boot <recovery_filename>.img
    

Installing Android OS from recovery

  1. Download the Custom Android Rom that you would like to install.

    • Optionally, download additional application packages such as Google Apps (use the arm64 architecture).
  2. If you are not in recovery, reboot into recovery:
    • With the device powered off, hold Volume Up + Power. Keep holding both buttons until the “Redmi” logo appears on the screen, then release.
  3. Now tap Wipe.
  4. Now tap Format Data and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage.
  5. Return to the previous menu and tap Advanced Wipe, then select the Cache and System partitions and then Swipe to Wipe.
  6. Sideload the Android OS .zip package:
    • On the device, select “Advanced”, “ADB Sideload”, then swipe to begin sideload.
    • On the host machine, sideload the package using: adb sideload filename.zip.
  7. (Optionally): If you want to install any add-ons, repeat the sideload steps above for those packages in sequence.

  8. Once you have installed everything successfully, run ‘adb reboot’.
  9. (Optional): Root your device by installing Magisk.

Installing Kernel from recovery

  1. Download the Custom Kernel that you would like to install.

  2. If you are not in recovery, reboot into recovery:
    • With the device powered off, hold Volume Up + Power. Keep holding both buttons until the “Redmi” logo appears on the screen, then release.
  3. Now tap Install and select Kernel package .zip
  4. Once you have installed everything successfully, click the back arrow in the top left of the screen, then “Reboot system now”.