Writing mostly about computers and math.


The CyanogenMod Logo

So, I went to upgrade my phone to the latest CM snapshot and every time I tried to install it my phone would just reboot. I think this must be related to the fact that I recently enabled encryption on the device since I can't think of anything else that I've changed since the last time I updated it. I googled around a little bit and found a process that works on my Nexus 5, so I thought I'd document it here in case anybody else (including future me) needs to know how to do it.

First we need to install the Android Debug Bridge, which, on Ubuntu 14.04 is in the package android-tools-adb. Most Linux distros should have a similar package and Windows and OS X users can download the Android SDK from Google.

A picture of the Android debugging checkbox

Once that's installed, put the device into debug mode by checking the "Android debugging" box under Developer Options in settings (if you don't see this option, tap the Build number under "About phone" 7 times to enable it).

Next, download the build you want to install on your device from https://download.cyanogenmod.org/. My device's codename is hammerhead, so I'm downloading from this page.

After downloading the build of your choice, connect your device to your computer with a USB cable and reboot it into recovery mode (on my Nexus 5, it's power + volume down). When the device has entered recovery mode, open a terminal and make sure the device is showing up.

$ adb devices
List of devices attached
048e00f1093ab860    recovery

If you see this, everything is working fine. Now, I'm using ClockworkMod as my recovery ROM, so I'll sideload the update by selecting "install zip" and "install zip from sideload" (on the stock recovery, it's something like "apply update from ADB"). To sideload the OS, use the command adb sideload /path/to/file.zip once the phone is ready to receive the file.

Installation should start automatically when the sideload finishes. After a reboot, I found myself updated to the latest version of CyanogenMod despite the device encryption, so hopefully it will work for you too.