Install LineageOS on z3

Special Requirements

  1. Download and install Flashtool on your machine
    • If you’re are a Windows user of any version, open a file explorer and navigate to C:\Flashtool\drivers folder, then install the drivers found within
    • Additionally, if you are a Windows 8.1 (x64) user you will need a patch found here
  2. Reboot your machine
  3. On the device, navigate to the Settings app, in the System menu, under the About this device listing, and take note of your model number & carrier
  4. Open Flashtool
  5. Click the symbol to download and open XperiFirm (round button on the right) to download the latest firmware for your device
  6. In XPeriFirm, select your device and an appropriate firmware on the middle column with the version 23.5.A.1.291. Then click on the firmware on the right side below Available Firmware and download it
  7. After the download finished, close XperiFirm. Flashtool now automatically recognizes the downloaded files and prepares the image to be flashed
  8. Now click on the lightning symbol (flash device), select Flashmode and click on OK
  9. Select the firmware file you just downloaded above
  10. Check all the boxes under the “Wipe” menu
  11. Click “Flash”
  12. Turn off your phone
  13. Hold the volume-down button and keep holding while connecting the device to your PC
  14. Once the flashing process has started, release the volume rocker as soon as possible
  15. When the flash finishes, boot up the device and once booted, please proceed with the instructions

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. On the device, dial *#*#7378423#*#* (*#*#SERVICE#*#*) to launch the service menu.
  2. Go to service info > configuration and check rooting status - you can only continue if it says Bootloader unlock allowed: Yes.
  3. Connect the device to your PC via USB.
  4. 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 Up and connect the USB cable. The notification light should turn blue.
  5. Once the device is in fastboot mode, verify your PC finds it by typing:
    fastboot devices
    
  6. Follow the instructions on Sony’s official unlocking website to generate an unlock code for your bootloader.
  7. Use your code to unlock the bootloader of your device:
    fastboot oem unlock <your_unlock_code>
    
  8. 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 one here.

  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 Up and connect the USB cable. The notification light should turn blue.
  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 Down + Power. Keep holding both buttons until the device vibrates, 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 LineageOS from recovery

  1. Download the LineageOS installation package that you would like to install or build the package yourself.

    • Optionally, download additional application packages such as Google Apps (use the arm architecture).
  2. If you are not in recovery, reboot into recovery:
    • With the device powered off, hold Volume Down + Power. Keep holding both buttons until the device vibrates, 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 LineageOS .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 additional add-ons, repeat the sideload steps above for those packages in sequence.

  8. (Optional): Root your device by installing LineageOS’ AddonSU, (use the arm package) or by using any other method you prefer.
  9. Once you have installed everything successfully, run ‘adb reboot’.

Get assistance

If you have any questions or get stuck on any of the steps, feel free to ask on our subreddit or in #LineageOS on freenode.