How to set up/manage services on a computer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3.5 KiB

how to install lineageOS on android phone

specifically, I will use the lineageOS+microG version, but any should work.

Back up you phone

First, back up your phone

Download Android platform tools to your computer

You will have to have the Android Platform tools on your computer. On linux it can just be run as a binary:

mkdir android-platform-tools
cd android-platform-tools
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip
rm platform-tools-latest-linux.zip
mv platform-tools/* .
rmdir platform-tools/

Debian packages also exists:

sudo apt install android-sdk-platform-tools

You may need to reboot to make updated udev rules take place.

Plug your phone into your computer, and enable Android debugging via ADB in your phone's developer options (if developer options aren't available, tap the "Build number" field in the "About Phone" section 7 times).

Make sure adb sees your phone by running:

adb devices

A message may pop up on your phone asking if you want to allow your computer to permission access your phone.

(Once per device) Unlock Bootloader

Only needs to be done once per device. Probably the hardest part. Enable OEM unlock in the Developer options under device Settings, if present.

Reboot into fastboot mode by running:

adb reboot bootloader

Once the device is in fastboot mode, verify your PC finds it by running:

fastboot devices

Then unlock the bootloader by running:

fastboot oem unlock

If the device doesn’t automatically reboot, reboot it. It should now be unlocked. Since the device resets completely, you will need to re-enable USB debugging to continue.

Install Custom Recovery

Download the latest image of your preferred recovery distro. The LineageOS team recommends TWRP.

Reboot into the bootloader once again:

adb reboot bootloader

Make sure fastboot sees your phone:

fastboot devices

Flash recovery onto your device:

fastboot flash recovery ${recovery_filename:?}.img

Reboot into recovery to verify that the recovery was installed: Turn the phone off, then hold Volume Down+Power to boot into recovery.

Note: If you've never updated your device firmware, the latest recovery version may not work. Try installing an older version.

(Optional) Update Firmware

Download the latest version of the firmware for your device:

  • Firmware for the OnePlus 5 is available here.

Boot into recovery. In the recovery, select the "Advanced" option, and from there select "ADB Sideload".

On your computer, run:

adb sideload ${firmware_filename:?}.zip

Install LineageOS

Download the latest version of LineageOS, or if you prefer, LineageOS for microG.

Boot into recovery.

Wipe the device by tapping the "Wipe" option, and then the "Format Data" option.

Return to the "Wipe" menu, and now select "Advanced Wipe", and wipe the "Cache" and "System" partitions.

Go back to the main menu, and select "Advanced", then "ADB Sideload". On your computer, run:

adb sideload ${OS_filename:?}.zip

(Optional) Install GApps

If you aren't using microG, you should install GApps now.

(Optional) Install SU

If you want to be able to run apps as root, you will need to install SU. Download the SU addon from here. Then sideload it as well.