How to install an Android-based OS in an Android device

This post is about how to install an Android-based OS (like LineageOS, Replicant, /e/, etc.) in an Android device that has installed Android device.
It intends to be generalist and give an overview of the most common steps, and not to dive into details.

Basic Concepts

adb

adb stands for Android Debug Bridge. It is a toolkit to operate with device from host computer.

If you run macOS X, you can check this post about how to install it.

Fastboot-like mode

Fastbood-like Mode is a special boot mode for Android devices that allows user to access device in maintenance mode and perform tasks like add a custom recovery

Not all devices call this mode in the same way and the mode may vary. It depends mostly on the manufacturer. Some examples:

  • Fastboot Mode for most devices
  • Download Mode for Samsung devices

Recovery mode

Device can be started on a special mode called ‘recovery mode’, that allows to perform OS maintenance tasks like default system delivery.

Devices come with a default recovery called ‘stock recovery’ that is executed automatically when booting Recovery Mode. The functionality on default recovery mode is limited, and cannot be used to install a different OS than the default one..

Custom recovery

Stock Recovery can be substituted by a default Custom Recovery. Through a Custom Recovery we will be able to load an OS image into the device.

Example of custom recovery software:

  • TWRP
  • CWM (ClockworkMod)
  • Philz

rooted device

A rooted device means that user has all permissions to perfor any action on the device, without security permissions. Devices sold by manufacturers usually come unrooted.

A user can root by following instructions that can be found on the internet.

However, rooting a device have some consequences:

  • Some app developers (like Netflix) may deny to allow to install their apps on rooted devices.
  • Warranty is lost.

General installation steps

To perform these steps you need:

  1. The Android device where you want to install the OS
  2. A host computer with Windows, MacOS X or Linux, to drive the device installation
  3. An USB cable to link host computer to device

1. Install adb on your computer

Follow instructions available on the internet.

2. Install fastboot-like mode interface on your computer

The application depends on the fastboot-like mode your device works with:

  • If your devices works with standard Fastboot Mode, fastboot command must be installed
  • If your devices works with Download Mode (as Samsung devices), heimdall must be installed

3. Configure your device to be connected through adb

To allow to connect adb through your device, you may perform these steps:

  1. Enable Develop mode on Android device
  2. Enable Android/USB debugging on the Android device

4. Ensure interface with Fastboot-like Mode works properly.

Instructions depends on Fastboot-like Mode used by your device.

5. Install Custom Recovery on device

There are two possibilities:

  • Install Custom Delivery app on Android, and flash Custom Recovery. This only works if your device is rooted.
  • Turn device in Fastboot-like Mode, and used your Fastboot-like Mode interface to load the Custom Delivery.

6. Get OS ROM/build image

Download the ROM for your custom OS.

You might build it yourself, if you have the skills and motivation.

7. (optional) Get images for extra apps

Get images for extra apps like GApps.

GApps is a package from Google that includes some apps that are installed as default in Google’s Android. Some users may miss these apps when they start the custom OS, as they include Play Store and other Google Apps.

https://opengapps.org/

To download the correct GApps, it is important to know:

  • Architecture of your device (arm, arm64, x86, x86_64…).
  • Android-equivalent version of the custom OS you are going to install.
  • The variant you want to install (you may want just to install Play Store, or other functionalities)

8. Wipe device

It may consist of a few substeps, like wiping device, delete cache, etc.

(optional) 9. Root your device

You may want to root your device. Take into account the notes on ‘Basic Concepts’.

Take also note that is not always necessary to root your device in order to install the custom OS.

10. Load OS

Load OS into the device using Custom Recovery.

11. (optional) Load extra apps

Load extra apps into the device using Custom Recovery.

12. Test that new OS is working

Start your device on normal mode and check that everything works fine.

You might be interested also in…

External references

One comment

Leave a Reply to Open Source projects based on Android – RunModuleCancel Reply

Your email address will not be published. Required fields are marked *