[HOW-TO] Install LineageOS 18.1 on the Google Pixel 3a XL (bonito) w/ Google Apps and Magisk (root)

Search This thread

KJ7LNW

Member
Jun 20, 2021
48
11
I've been trying to find a good phone for my wife that is officially supported by LineageOS and settled on the Pixel 3a. If you're thinking of purchasing this device, make sure the listing says that it has an UNLOCKED BOOTLOADER. Just "unlocked" doesn't cut it, you'll probably get a phone that works on any carrier but won't allow an OEM unlock. Third time is the charm, we finally ordered from eBay; the listing said unlocked bootloader, and it was.

I had some trouble getting started so hopefully this will help others. This guide will probably work on the Google Pixel 3a (sargo, not XL), and possibly other Pixel devices as well assuming you adjust your release version appropriate to your model.

Note that TWRP doesn't work well (or at all), and don't even try because the Pixel 3 and newer are slot A/B devices so LineageOS uses their own recovery to manage switching between boot slot A/B during update. (Of course, if you do get TWRP working, then I do prefer it so let me know how!)
  1. Enable developer mode
  2. OEM Unlock: method 1, method 2
  3. Unlock the bootloader:
    1. adb reboot bootloader
    2. fastboot flashing unlock
  4. Install the latest android platform tools for fastboot and adb:
  5. Install the official Android 11:
    1. https://developers.google.com/android/images?authuser=3#bonito
    2. Agree to terms and conditions
    3. Download the latest v11 zip (RQ3A.211001.001, Oct 2021)
    4. Unzip and run:
      • Windows: flash-all.bat
      • Linux: ./flash-all.sh
    5. Repeat #3 above if necessary
  6. Download and transfer LineageOS 18.1:
    1. https://download.lineageos.org/bonito
      1. Download the latest recovery .img to your desk
      2. Download the latest .zip to your desk
    2. Install the recovery image:
      1. fastboot flash boot_a lineage-18.1-20211023-recovery-bonito.img
      2. fastboot flash boot_b lineage-18.1-20211023-recovery-bonito.img # (might not need this one)
      3. Reboot to recovery (may need to power off first)
    3. From the Phone: In recovery it should show the LineageOS icon:
      1. Advanced->Enable ADB (may not be necessary)
      2. Apply Update
      3. Apply from ADB
    4. From your desk:
      1. adb sideload lineage-18.1-20211023-nightly-bonito-signed.zip
      2. If you get errors like error: protocol fault (no status) then your version of adb is too old.
      3. It should say Total xfer: 1.00x but the official LineageOS installation docs say that it might hang at 47% and that is ok because it is done transferring to the phone at that point.
    5. From your phone:
      1. If you want the Google Apps add-on on your device, you must follow this step before booting into LineageOS for the first time!
        1. If so, then tap Apply Update->Apply from ADB and follow Google Apps .zip install notes below in #7.3
        2. If not, then tap the left return arrow and then tap "reboot now"
  7. Optional ZIPs:
    1. If you are already in recovery, go to step #7.2. Otherwise, get into recovery. If you already booted into LineageOS, then I find it easiest to reboot into recovery by enabling "Advanced Restart" :
      1. Systems->Advanced->Gestures->Power->Advanced restart
      2. Then hold down the power button and select Power->Reboot->Recovery
    2. To install zips:
      1. First mount /mnt/system: Adbanced->Mount/Unmount System
        • This is necessary because the Pixel is a A/B boot slot device and not all .zip's will know how to mount.
      2. Use adb sideload <filename.zip> as in #6.4 above (but with the .zip you want!)
      3. You may be prompted on your phone to install even though the signature is untrusted.
    3. Download the latest Google Apps for arm64. (Do this before booting LineageOS for the first time!)
      1. Most people recommend MindTheGapps,however:
        1. Because the Pixel is a A/B boot slot device, MindTheGapps doesn't know how to mount /mnt/system so it fails.
        2. This is probably a bug in MindTheGapps, if you find a way to fix it let me know.
      2. Others like OpenGApps.
        1. I installed this one, but for some reason it didn't work the first time. It did the second! Maybe I missed something.
        2. Well Play Store is hanging, so trying MindThe Gapps
    4. Root your device with Magisk:
      1. Download the latest Magisk APK:
      2. Note that the .apk is also a .zip, so rename it if you must (but I didn't need to).
      3. Enable adb
      4. Install the apk:
        • adb install Magisk-v23.0.apk
  8. Troubleshooting:
    1. LineageOS recovery doesn't like to install multiple zips at once. If you get the error adb: sideload connection failed: closed then click the left back arrow, then again folow steps from 6.4
    2. Try factory reset if you have boot issues the first time
 
Last edited:

cou94114

Member
May 11, 2014
41
18
San Francisco
Nexus 6
Moto G7
In Step 5, sub-step 3 you typed "Download the latest v11 zip (SP1A.210812.015, Oct 2021)". The latest Android 11 image for bonito is "RQ3A.211001.001, Oct 2021". The image you reference is the new Android 12 image for bonito.