Install /e/OS on a Sony Xperia XZ2 - “akari”
The instructions in this guide will assist you to install /e/OS on your akari. Please read through the instructions at least once before actually following them, so as to avoid any problems later.
It is important that you know that downgrading Smartphones on OS versions greater than the /e/OS OS version you plan to install, can cause instability or at worst brick some devices. We recommend that you check your current OS version, before attempting the installation.
It is advisable to flash your device only if you know what you are doing and are ok taking the associated risk. All /e/OS builds are provided as best effort, without any guarantee. The /e/OS project and its project members deny any and all responsibility about the consequences of using /e/OS software and or /e/OS services.
Requirements
- If required take a backup of all important data from your phone on an external storage device before proceeding.
- Do not take a backup on the same device as some of these actions will format the device and delete the backup.
- Ensure your phone is charged more than 50%
- Check that
adb
andfastboot
are enabled on your PC. If not you can find the setup instructions here - Download all the files and images mentioned in the download section below before starting the installation
-
Make sure you have a working data cable to connect your device to the PC. There are cables which are only for charging and do not transfer data.
- Enable USB debugging on your device. You can find the instructions here
- Make sure that your model is listed in the Smartphone Selector. Check the model supported. Where available, information on the model supported should show as a pop-up when you hover the cursor on the Device name. The model number supported should be the exact same.
- Boot your device with the stock OS at least once and check every functionality.
Please share your experience , suggest tips or changes to this install guide documentation by visiting the Xperia XZ2 specific topic on our community forum.
To report issues in /e/OS please refer this guide
Downloads for akari
Try the /e/OS Recovery (limited functionality)
- /e/OS build : U community
To understand the difference between /e/OS builds check this guide
- Before following these instructions please ensure that the device is on the latest Android 10 firmware.
Unlocking the bootloader
- On the device, dial
*#*#7378423#*#*
(*#*#SERVICE#*#*
) to launch the service menu. - Go to
service info
>configuration
and checkrooting status
- you can only continue if it saysBootloader unlock allowed: Yes
. - Connect the device to your PC via USB.
-
On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:
adb reboot bootloader
- Follow the instructions on Sony’s official unlocking website to unlock your bootloader.
-
Use your code to unlock the bootloader of your device:
fastboot oem unlock <your_unlock_code>
- Since the device resets completely, you will need to re-enable USB debugging to continue (Settings->About Phone->Build version, and then you can go to Settings->Developer opptions to enable USB debugging).
Temporarily Booting a custom recovery using fastboot
-
Connect your device to your PC via USB.
- On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:
adb reboot bootloader
- Once the device is in fastboot mode, verify your PC finds it by typing:
fastboot devices
- Flash a recovery image onto your device
fastboot flash boot recoveryfilename.img
Replace the
recoveryfilename
with the name of the recovery image you downloaded in the previous section - Manually reboot into recovery mode
- With the device powered off
- hold Volume Down + Power
Ensuring all firmware partitions are consistent
In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of the active slot to the inactive slot.
To do this, sideload the copy-partitions-20220613-signed.zip
package by doing the following:
-
Download the
copy-partitions-20220613-signed.zip
file from here. It should have a MD5 sum of79f2f860830f023b7030c29bfbea7737
or a SHA-256 sum of92f03b54dc029e9ca2d68858c14b649974838d73fdb006f9a07a503f2eddd2cd
. -
Sideload the
copy-partitions-20220613-signed.zip
package: * On the device, selectApply Update
, thenApply from ADB
to begin sideload. * On the host machine, sideload the package using:adb sideload copy-partitions-20220613-signed.zip
-
Now reboot to recovery by tapping
Advanced
, thenReboot to recovery
.
Steps to install /e/OS using /e/OS recovery
Advanced
» Enable adb
On /e/OS Recovery Main Screen:
- Select
Factory reset
- Select
Format data / Factory reset
option - Next screen will display a warning that this action cannot be undone
- Select
Format data
to proceed orCancel
if you want to go back -
If you selected
Format data
..the format process will completeTip: You will see text in small font on the lower left side of the screen mentioning format progressThe small font text would be similar to this
Wiping data Formatting/data Formatting/cache Data wipe complete
-
Display will now return to the Factory Reset screen
Tip: Use the volume up key to choose the arrow at the top to go back to main screenIn /e/OS Recovery main screen:
- Select
Apply Update
and in next screenApply update from adb
-
In the next screen, the device is now in sideload mode
Note at this point the Cancel option is highlighted that does not mean you have canceled the action. The device is in adb sideload mode.
-
On your PC type begin adb sideload. Type the below command in a console
adb sideload downloaded_file_name.zip
Replace downloaded_file_name.zip with the name of the /e/OS file you downloaded in the previous section
- Press
enter
key on the keyboard to start the sideloading The screen will show the progress percentage…This might pause at 47% - Give it some time
- The PC console will now display
Total xfer: 1.00x
- The phone screen will now display some text with a message similar to
Script succeeded result was [1.000000]
This means that the install was successful
- Use the
volume key
to select theback arrow
on the top left of the phone screen - Go back to the main screen and select
Reboot system now
The reboot process may take 5 - 10 minutes
To find some troubleshooting tips… click here
adb
- Getting a
Total xFer ':' 0.01x
message - Try to upload the /e/OS to internal storage and retry to install adb ':' sideload connection failed ':' insufficient permissions for device
error - Try to execute the commandsadb kill-server
andadb start-server
and retry- Running
adb shell twrp install /sdcard/</e/OS zip package>
raise non-existent directory error - Try to check solution here - Getting an
insufficient permissions
error - Try the solution given here - When running "adb devices" in bash a device is shown as "unauthorized" - Try the solution given here
TWRP
- Errors while running TWRP version 3.4.x.x or above - Try downloading and using a previous TWRP version.. below 3.4.x.x
- In TWRP if this error shows up
failed to mount /preload
- Try in TWRPwipe
screen in advanced menu selectpreload
andswipe to wipe
/cache/recovery/xxx -> no such file or directory
error while flashing a ROM - On PC runadb shell
in the console now create a folder called recovery for e.g. here the devicecode name is violet "violet :/cache# mkdir recovery"
Connectivity
- Trying to troubleshoot mobile connectivity issues - Read this guide
Please share your experience , suggest tips or changes to this install guide documentation by visiting the Xperia XZ2 specific topic on our community forum.
To report issues in /e/OS please refer this guide
This documentation “Install /e/OS on a Sony Xperia XZ2 - “akari”” is a derivative of “install LineageOS on akari” by The LineageOS Project, used under CC BY.