Installing CyanogenMod on HTC Sensation

After using the stock Android ICS that came with my Sensation for a couple of years and getting fed up with it crashing and being slow all the time, I decided to try out the CyanogenMod (CM) everyone was talking about. When I started with this endeavour, I was a bit overwhelmed by the amount of incoherent/incomplete resources all around. In this post, I’ll try to summarise the steps necessary to install it in a more human way to help others achieve the same goal.

HTC Sensation and the material design of CM 12

Note: before starting any of this, backup (e.g. by syncing them to Google) all your personal data from the phone – contacts, pictures etc. The process will wipe it all!

The main, but partially outdated instructions to install CM on the Sensation (code-named Pyramid) can be found on this wiki site. The main difference now is that it’s no longer necessary to get S-OFF or use the Revolutionary app. It’s sufficient to unlock the phone on the HTC dev site by following their instructions (at the end these instructions will perform a factory reset). The recovery image can be set up by following the first part of these instructions to boot a recovery image. I downloaded the latest recovery (at the time the 5.0.2.0 normal version, not the touch version) from the official ClockworkMod site that supports CM 10. Later, I also figured out how to install the newer CM 12 based on Lollipop, so I’ll document these settings as well.

If you want to install CM 12, however, you need a newer version of CWM. I tried the CWM Advanced edition based on CWM 6.0.4.8 for Pyramid and I couldn’t boot into this recovery. Then I tried the Team Win Recovery Project for Pyramid 2.8.5 and I was able to successfully install CM 12. I flashed that recovery in the end, but you might first try it to see for yourself.

To install adb and fastboot on Ubuntu do:

sudo apt-get install android-tools-adb android-tools-fastboot

To boot the recovery enable debugging via USB in the phone setting and run:

Note that we didn’t have to flash the image right away, but could boot it directly. This is useful to first see if we’ll be able to do everything we need with this recovery image before physically flashing it over the stock recovery image.

First choose the backup option to save the current stock Android ROM to an image. I had to first format the /data partition – this is just our user data and documents (hope you have it backed up by now already). Once the command is done, you can find the folder with the backup (for me it was something /sdcard/clockworkmod/backup/) by issuing sudo adb shell and cd-ing through the folders. Pull that folder to your computer to save it elsewhere just in case: