Sony Xperia Z2 upgrading to CyanogenMod 11
By Leo Gaggl
Contrary to my normal inclinations not to buy anything but Stock Android phones I ended up with a Sony Xperia Z2 in a hurry over the weekend (it’s a long story…). It appears to be quite a decent handset (with a pretty good camera actually) and one of the main reason to choose this over the other options was that is was one of the few high-end devices which already had a CM snapshot rather than just nightly releases. However similar to their colleagues at Samsung the Sony people also opted to stuff all sorts of crap-ware bloat onto the Android base OS. It appears not to be as bad as the Samsung (who are the kings of crap) mods, but for somebody used to the clean Android experience it’s just very annoying. So I opted to flash it straight to CyanogenMod.
You need the Android SDK installed and on your Path – see one of my other posts on how to do this.
Get Bootloader Unlock Code
Another annoying step which is not required with Google Nexus series.
http://unlockbootloader.sonyericsson.com/instructions
You will need to enter and confirm your email (WTF?) and need your IMEI number and at the end of the process you will get an update key that is required below.
Put phone into bootloader (fastboot) mode
Insert one end of the USB cable into your PC. Turn off the device and wait at least 5 seconds. Press and hold the Volume Down button and plug the other end of the Micro-USB cable in to your device.
fastboot devices<br></br>#should display the ID of the connected phone<br></br>fastboot -i 0x0fce oem unlock 0xKEY
Download CyanogenMod Release
Extract the boot.img file from the downloaded ZIP file via https://download.cyanogenmod.org/?device=sirius
fastboot -i 0xfce flash boot boot.img<br></br>fastboot -i 0xfce reboot
This should boot into Clockwork Mod Recovery and you can use the Volume +/- to navigate and On/Off button to choose.
Select the “Wipe data/factory reset” option
Note: this part was not in the CM Wiki or anywhere else and took me a while to get past. If you see an error “Error Mounting /sdcard/.android_Secure!” during the factory reset procedure you need to format the data partition manually. If you do not do this step the CM install will still work but you will not be able to boot the phone (it gets stuck at the Boot Animation).
Mount /data<br></br>Format /data
After the manual format procedure do the “Factory reset” again.
Install CyanogenMod
Choose the “Install zip from sdcard –> Install from sideload” option
adb sideload cm-11-20140804-SNAPSHOT-M9-sirius.zip
After the install has finished choose the “Reboot system now” option.
CM Wiki Entry: http://wiki.cyanogenmod.org/w/Install_CM_for_sirius