Get Files Ready
Download the system packages and tools
To safely install Android 13 onto your Sony Xperia X Compact (kugo), create a folder on your computer named C:\XperiaFlash and download these files into it:
LineageOS 20 ROM (Android 13)
This is the core Android 13 operating system file built specifically for your Xperia X Compact.
TWRP Recovery Archive
Contains the tool and installer package needed to boot, wipe, and clear system software safely.
To flash and load files onto your phone, you need to extract the raw images inside your downloads:
Open twrp.zip and copy the file named twrp-3.6.1_9-1-kugo.img out into your C:\XperiaFlash folder.
Open your downloaded lineage-20.0-20240129-UNOFFICIAL-kugo.zip, find the file named boot.img, and copy it out into your C:\XperiaFlash folder.
Your folder should now have: the ROM zip, twrp.zip, twrp-3.6.1_9-1-kugo.img, and boot.img all sitting together.
Turn on Developer Settings
Configure your phone to allow computer control
Before connecting your phone to your computer, you need to turn on some hidden settings inside your phone's Android menu.
Tap "Build Number" 7 Times
Open your phone's Settings > System > About Phone. Find the row that says Build Number. Tap it rapidly 7 times in a row until your screen says "You are now a developer!".
Turn on OEM Unlocking
Go to Settings > System > Developer Options. Scroll down, find OEM Unlocking, and turn it ON. Enter your phone PIN or lock screen pattern if it asks you to.
Turn on USB Debugging
In the same Developer Options menu, scroll down and turn ON USB Debugging. This allows your computer to send commands to your phone over a USB cable.
Install ADB Tools on Your PC
A quick way to set up the connection tool on Windows
To talk to your phone, your computer needs a helper tool called **ADB**. If you do not have it, you can install it easily using Windows PowerShell with these simple commands:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
scoop install adb
Connect Phone & Open Folder
Tell the computer where your files are located
Plug your Xperia into your computer using a USB cable. Before you run any verification checks, you must navigate your terminal to the folder containing your files, otherwise the computer will not find them!
cd C:\XperiaFlash
If you do not run this command first, the computer will look in the wrong directory and fail to flash TWRP or your boot files later.
adb devices
SHA256:fK49Y8...
[ LOOK AT YOUR PHONE SCREEN ]
As soon as you run that command, a popup window (just like the drawing on the left) will appear on your phone screen.
Check the box that says "Always allow from this computer" and tap "ALLOW" on your phone.
Unlock Your Phone's Bootloader
This unlocks your phone to let you install custom software
By default, Sony locks the phone software system. You need to get an unlock authorization key directly from Sony to open it up.
1. Open your phone dialer app, and type *#06# to find your 15-digit IMEI number. Write it down.
2. Go to the official Sony Unlock Web Portal. Type in your IMEI number, and Sony will give you your unique Unlock Key string.
fastboot oem unlock 0xYOURKEY1234
Install TWRP & Android 13
Load the core files and transfer Android 13 to your phone
We will now install the boot starter file, load TWRP temporary recovery image, use TWRP to clean your phone, and then copy Android 13 over.
fastboot flash boot boot.img
fastboot boot twrp-3.6.1_9-1-kugo.img
On your phone screen, tap Wipe > Format Data. Type the word yes and click the checkmark. This deletes all old files so the new Android works smoothly.
Go to the main menu of TWRP on your phone, tap Advanced > ADB Sideload. Swipe the slider at the bottom, then type this command on your computer to push the recovery installer:
adb sideload twrp.zip
On your phone, go to Advanced > ADB Sideload again, swipe the slider, and type this command on your computer to install your Android 13 file:
adb sideload lineage-20.0-20240129-UNOFFICIAL-kugo.zip
adb reboot