Table of contents:
One of the most remarkable things about most Android devices is the amount of choice they have about which version of the operating system to use. If we buy a smartphone with great hardware but aren't satisfied with the software, we can usually install a different version that does.
Depending on the device, we will have, at least potentially, dozens of versions of Android that we can install Some are created and maintained by a team of developers, while others have a single developer overseeing all aspects.Best of all, they're free.
The largest and most popular custom Android experience is LineageOS. Previously known as CyanogenMod (and later just Cyanogen), LineageOS is a version of Android with additional features that make our device more powerful and customizable.
One of the great things about LineageOS is that it allows us to update many devices to the latest version of Android, even if the stock updates for that device are long overdueThis gives new life to phones and tablets that would otherwise pass away.
Installing a new operating system on our Android terminal may seem like an odyssey, but if it is done in steps, it can be easy. It helps that there's also a wide margin of error so beginners don't have to worry about crashing their devices.
This is what we will need to update a ROM:
Compatible Android smartphone or tablet USB cable for that device Laptop or desktop computer running Windows, macOS, or Linux an internet connection Time (this could take an hour or two, depending on how familiar we are with the technologies involved)
Step 1
Some rare devices allow us to flash new ROMs without first connecting them to a computer. However, the vast majority of devices will need access to a computer running Windows, MacOS, Linux, or even Chrome OS.It can be a ten-year-old laptop or a high-performance desktop; it doesn't take a lot of power to flash a ROM
Usually the software you need is ADB. ADB is hosted and maintained by Google, so there are no worries about viruses or malware when downloading and installing the program. We can visit this page to follow explicit instructions on how to download and install ADB for the computing platform we need. It doesn't take long and the instructions are very simple.
Once you've installed ADB, we'll have access to it through a command prompt on Windows or a terminal window on Linux and MacOS. This may seem difficult, but don't worry, the commands are extremely simple and easy to copy and paste.
A tip: Occasionally we will connect our Android device to our computer to connect to ADB.When we do this, we need to make sure that we are using the USB cable that came with the device. If we do not have it, we must use a high quality cable Cheap cables could cause problems with flashing, so better not risk it.
Step 2
To get LineageOS, we must first verify that our device is compatible with the ROM We go to the LineageOS wiki and do a search for the device you want to flash. LineageOS is compatible with most popular devices from almost all major manufacturers. Unless we have an extremely cheap device, we can probably install at least one version of LineageOS.
When we get to the list of files associated with our device, we will only download the file with the most recent upload date. Once we have downloaded the file to the computer, we can exit the LineageOS site.However, we don't just need the LineageOS package; we will also need to download the custom recovery package as well as the Google application package.
The most popular custom recovery is called the TeamWin Recovery Project, or TWRP for short. We can download TWRP for our device by going to the TWRP website and doing a search. It is mandatory that we indicate the exact model of our device before downloading TWRP or LineageOS. There are many variants of the Samsung Galaxy S5 and therefore many versions of TWRP and LineageOS labeled Galaxy S5.
We will also need a package of Google applications. If we don't install them at the end of the flashing process, we won't have Google products on the device when it boots, including the Google Play store. We cannot install the applications later, we must do it during their original flash.
Once we have downloaded those three packages, we move the files to the same location as the ADB files we installed in the previous stepThen we change the name to simpler things; for example, the TWRP filename is very long and complicated (twrp-3.2.2-1-xxxx.img). We changed it to just TWRP.img. This will make it easier to find the files later and also save us from typing a bit of command line typing.
We rename each file we download as such:
twrp-x.x.x-x-xxxx.img> TWRP.img
lineage-xx.x-xxxxxxx-nightly-xxxx-signed.zip> LINEAGE.zip
open_gapps-xxxxx-x.x-xxxx-xxxxxxx.zip> GAPPS.zip
Don't forget to move them to the ADB folder (for Windows, that's % USER PROFILE% \ adb-fastboot \ platform-tools ). Once all the files are organized, we are ready for the next step.
Tip: Our device has a code name that LineageOS, TWRP, and GApps will use to identify it.The name of the code is shown in the list of devices compatible with LineageOS: we use it to search for compatible packages, that way we know that we are always downloading the right one.
Step 3
There are many different ways to back up a device. There are free and paid apps on Google Play, as well as free and paid software for computers. A good method to back up a device is to use Helium. If we connect the phone to the Helium desktop client, we can make a backup copy of practically everything we have on the phone from the computer without having to root the terminal first
Once we have everything backed up, we will need to do two things on the device before moving on to the next step: enable USB debugging and OEM unlock.These are two buttons in the settings panel of our device, hidden in a section called “Developer Options”.
We did a google search for “access Android developer options” to find instructions on how to access these two toggles (usually it involves tapping a bunch of times on your build number Android in Settings). Once we have access to the developer options, we activate both USB debugging and OEM unlocking. If the OEM unlock is not there, nothing happens: we just make sure that USB debugging is turned on. Once we have done all that, we connect our phone to the computer with a USB cable. We may see the drivers being installed on the computer, which is normal.
Step 4
The steps to unlock the bootloader of our device will vary depending on the brand and model of the phone or tablet.Some OEMs make the process incredibly easy, while others make it very difficult. So this step will vary wildly depending on the device, so it's hard to give explicit instructions To make life easier, we go to XDA Developers and search for the forum for our device. We read the threads and whether other users have successfully unlocked the bootloader. If everyone else seems ok, you'll be fine.
If we find that other users have problems with the bootloader, it could be for a few reasons. It may be because the device is too new, so no one has figured out the process yet. It could also be that the bootloader is protected and difficult or impossible to unlock; Samsung is famous for this. Once we are sure that the bootloader is unlockable, we go to the LineageOS installation guide for our specific device.There we will find step by step instructions on how to unlock the bootloader.
Remember: This will erase the data on your device.
In most of the cases, to unlock the bootloader we connect the terminal to the computer with a USB cable and then run some ADB and fastboot commands to unlock the phone:
An ADB command to ensure that the device is connected correctly.
An ADB command to reboot the device into fastboot mode.
A fastboot command to verify that the device is in fastboot mode and connected correctly.
A fastboot command to unlock the bootloader.
If we are on Windows, we may encounter an error when we try the steps on the bootloader page for our device.The problem could be that the command prompt is not in the correct location. With the command prompt open, we must type the following command:
The first thing to do after connecting the device to the computer is to run this ADB command to ensure a successful connection:
cd %userprofile%\adb-fastboot\platform-tools
If after successfully connecting to ADB and rebooting into fastboot mode we have some problems, we probably need to update the drivers on the computer. We ran a Google search for "drivers" and downloaded and installed the latest version.
With all this done, we should be able to successfully unlock the bootloader. After the bootloader is unlocked, our device will reboot and enter Android settings, just like after a factory reset.
Before we continue to the next step, we need to make sure to enable USB debugging again. We go through the setup process of the terminal for the first time and then re-enable USB debugging. After factory reset, it may have been disabled, so we need to follow the same steps as before (turn on, connect to computer, etc.).
Step 5
Now that the bootloader is unlocked, it's time to update something on our device. This is a very important step. You will be flashing our smartphone software which will drastically change how it works As a final warning: flashing the wrong custom recovery on a device could cause error. We must be absolutely sure that the TWRP file you downloaded matches the device model
Once ready, fire up ADB via a command prompt and run the following commands:
adb devices
As before, the previous command ensures that the device is correctly connected to our computer. After that, we run this: adb reboot bootloader
And then: fastboot devices
Finally, after a double check, let's enter this: fastboot flsh recovery TWRP.img
Once ADB and fastboot finish flashing, we reboot the device into recovery mode. This usually involves a set of hardware keystrokes. Booting the OnePlus 5 into recovery mode involves turning it off and on while holding down the volume down key. We do a search in Google of the necessary steps to start our terminal in recovery mode.
Since we just flashed TWRP throughout its original recovery, the device will boot into TWRP when we press the specific hardware keys we found using Google. We will first see the screen below:
Step 6
Usually we just boot into Android and move the file from computer to the device after connecting the USB cable, but we can't boot into Android because we haven't booted it yet installed But don't worry, ADB can do all the file transfers we need. Before doing so, we need to make sure that there are no remnants of the previous version of Android left behind.
From the TWRP main menu, tap Wipe and then Format Data. TWRP will warn you that this is serious business, but since we backed up in Step Three, we have nothing to worry about. We follow the TWRP instructions and complete the format process.
After receiving the "Success" message, we press the back button until we return to the Clean page.We touch Delete advanced and we will see a series of checkboxes. If an item is checked, that section of the hard drive will be erased. We check the first three boxes: Dalvik / ART Cache, System and Cache and leave all the others unchecked.
We slide our finger from left to right on the slider marked Slide to delete. The cleaning process begins. Once this is done, we are ready to flash LineageOS. With the device still in TWRP mode, we connect it to the computer using the USB cable. We boot up a command prompt or terminal window in the ADB folder, perform a device check, and then use the "push" command to push the LineageOS file into the terminal's internal memory. The command to enter should be: adb push LINEAGE.zip /sdcard/
After typing that and pressing Enter, ADB will start pushing the LineageOS file to our device.This could take some time, and sometimes there is no progress bar to see the duration of the process. On the phone, we return to the main TWRP menu and tap Install. We will see a list of files available on the device, and the LineageOS package should be one of them We touch the file name and we will access a screen with three options: slide to confirm Flash.
TWRP will show LineageOS on our device and then tell us that it has been installed successfully. We will have two options: Clean cache/dalvik or Reboot system. We don't push any. We'll do it with the home button on the screen.
Step 7
Now all you need are Google apps like the Google Play Store, Google Play Services, Gmail, and Google Maps. We are going to flash the Google Apps ZIP file that we downloaded in Step 2 in the same way that we flash LineageOS.With the device powered on in TWRP and connected to the computer, we open an ADB command prompt and once again do an ADB device check. Then we write this command: adb push GAPPS.zip /sdcard/
Usually the Google app bundle is larger than our LineageOS bundle, so this process can take even longer than the first install we did in the previous step Once we finish the process, with our device we follow these steps:
Touch Install> Search Google package> Press package> Swipe to confirm Flash
After performing those steps, the update process begins. Once this is done, press Wipe cache/dalvik, wait a moment, and then press Restart system.
Step 8
If our first boot takes more than 15 minutes, something is wrongWe perform a reboot by holding the power button until the device reboots. We let the phone try to restart again. If it still won't boot or something didn't flash correctly, go back to Step 6. The first thing you'll see after a successful boot is a new boot animation, with the three circles of the Lineage OS logo in a curved line.
Once the boot is complete, we will be at the Android home screen, where we will choose the language, add our Google account, connect to Wi-Fi and so on. Once we're at the home screen, we're officially done: we have LineageOS on our device.
Conclusion
Depending on the device, there are probably many other custom ROMs besides LineageOS.Now that we know how to flash a ROM, we can enjoy flashing and testing all kinds of systems. All we need to do is find ROMs that match our terminal's model number and then repeat steps 6 to 8 No need to unlock bootloader or install a custom recovery again. Of course, we must make a backup copy of the device again.
If we try custom ROMs and decide we don't like them anymore, it's very easy to revert to the standard ROM our device came with from the factory. There is a different set of instructions for updating the stock, but the gist is the same.