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
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:

sudo adb reboot bootloader # now wait until your phone opens the bootloader...
sudo fastboot boot recovery.img # insert path to your recovery image here

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:

mkdir android_stock_backup
cd android_stock_backup
sudo adb pull /sdcard/clockworkmod/backup/2015-03-14.20.07.07 .

Select the wipe data/factory reset option. Afterwards do a cache wipe as well to clean out any remains of the files created by the older image.

The CM 10 (Jelly Bean) image is available from the official CyanogenMod page for Pyramid as a nightly build. I tested it and it works pretty good.

The CM 12 (Lollipop) images were created by a group of people here. They link to the CM 12 download site on Google Drive. Gapps can be downloaded from the CyanogenMod Google Apps wiki page. The images are device-independent and they have versions for both CM 12 and CM 10.

Copy the two images to the device. You first need to figure out where your SD card is mounted via cd and ls (for me it was under /sdcard).

sudo adb shell

You can then push the CM and Gapps zip files by issuing.

sudo adb push update.zip /sdcard/
sudo adb push gapps-lp-20141212-signed.zip /sdcard/

Finally, in recovery mode install zip from sdcard – first the ROM and then Gapps.

When you want to set the recovery mode permanently, while in the bootloader do:

sudo fastboot erase recovery
sudo fastboot erase cache
sudo fastboot flash recovery recovery.img

Then reboot the bootloader and select recovery.

If you’re done and everything seems to be working, you can format the SD card from Android afterwards, as you probably accumulated some unwanted files.

Published by

metakermit

Building apps, analysing data at Punk Rock Dev and sharing weird & cool photographs, drawings, music, films, games... More about me here. You can get new blog posts via RSS or follow @metakermit on Twitter where I also announce new stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *