Google’s Nexus 5 smartphone is the first to ship with Android 4.4 KitKat, and the stock software is pretty nice. But if you think you might want to install a custom ROM or custom recovery, it’s a good idea to unlock the bootloader right away – because it’ll wipe all your data, and it’s a good idea to unlock your device before you’ve spent hours customizing it.
Fortunately, Google makes that very easy to do.
Like most Nexus devices, you can unlock the Nexus 5 by installing the Android SDK, connecting the phone to your PC and running a “fastboot oem unlock” command. But there are even simpler ways to unlock the bootloader, root the phone, and install a custom recovery.
Warning: Note that unlocking the bootloader may potentially void your warranty — at least that’s the warning you’ll see in the confirmation screen. While Google makes it easy to unlock the bootloader on phones and tablets with the Nexus name, the company doesn’t really take responsibility for anything you do to mess up your device after that.
The good news is that once the bootloader’s unlocked, it’s hard to truly make a mess because it’s pretty simple to flash a custom ROM or stock ROM.
But if you’re not comfortable using a device that may not be protected by a warranty, you may want to stop now.
Unlock the bootloader and root the Nexus 5
Less than a week after the Nexus 5 started shipping, a handful of tools for unlocking and rooting the device have appeared. Perhaps the simplest to use is the Nexus 5 Multi-Tool, or Wug’s Nexus Root Toolkit, both of which lets you unlock, root, install a custom recovery, bakcup your device, or wipe it by connecting the Nexus 5 to a Windows PC.
Techfanatic9 also has a toolkit for Mac users.
But I went another way, using Chainfire’s CF-Auto-Root for the Nexus 5.
This is another utility that will unlock your bootloader and root your device in one fell swoop. It works with WIndows, Linux, or OS X, but the following instructions are written for Windows.
Here’s how to use it:
1. Download CF-Auto-Root for the Nexus 5, or “Hammerhead” from Chainfire’s download page.
2. Unzip the file to a folder on your PC.
3. Open a command prompt by typing “cmd” (without quotes) into the Run box on your Windows computer (or the Start Screen on Windows 8).
4. Navigate to the folder where you unzipped the file and prepare your phone before proceeding to step 8.
5. Power down your phone.
6. Boot your phone into bootloader mode by holding the power and volume up + volume down buttons simultaneously. If this doesn’t automatically take you to the bootloader screen and instead reboots you into Android, power down your phone and try again. It can be a bit tricky.
7. Connect your phone to your PC with a USB cable.
8. On your Windows PC, go back to the command box and type “root-windows.bat” without quotes and follow the on-screen instructions.
That’s it. CF-Auto-Root should send a command to unlock your bootloader, then you should see red Android logo on the screen as the phone is rooted (which means a SuperSU app is installed).
When the process is complete your phone will reboot, although it’ll take longer than usual to load. Don’t worry, next time you boot up your device, everything will go more quickly.
Note that since this process wipes all of your data, you’ll have to go through the Android setup process again.
If you’re using a Linux PC instead of Windows, in step 8 you’ll have to run two commands instead of one:
- chmod +x root-linux.sh
The OS X commands are similar:
- chmod +x root-mac.sh
You can also install a custom recovery, which lets you install custom ROMs, make a complete backup of your device, or perform other advanced functions.
Installing TWRP custom recovery
There are a few popular custom recovery tools including ClockworkMod and TWRP, but I’m partial to TWRP which offers many advanced functions as well as a user-friendly, touchscreen interface.
The simplest way to install TWRP on a rooted phone is usually to install the GooManager app from the Play Store and choose “Install OpenRecoveryScript” from the settings menu.
If that doesn’t work, you can also install TWRP manually. That’s not as scary as it sounds. You just need a working fastboot executable and the latest version of TWRP for the Nexus 5.
You an download the newest .img file from the TWRP page. It’ll be called something like openrecovery-twrp-184.108.40.206-hammerhead.img.
Next, if you’ve already installed the Android SDK on your computer, you’ll want to place the .img file in the directory where the fastboot.exe file hangs out.
You don’t necessarily need the full Android SDK though. Remember the Nexus 5 Multi-Tool I mentioned above? If you download and unzip it and navigate to the \Nexus 5 Multi-Tool\Working directory, there’s a fastboot.exe file in there.
So basically you can do this:
1. Download and unzip the Multi-tool.
2. Download the latest TWRP image file and place it in the “working” directory of the multi-tool.
3. Open a command prompt.
4. Navigate to the “working directory.”
5. Boot your phone into bootloader mode.
6. Type the following, without quotes: “fastboot flash recovery openrecovery-twrp-220.127.116.11-hammerhead.img”
Note that you should replace the name of the .img file with whatever version of TWRP you’re using.
When the process is complete, you should be able to boot into recovery mode a few different ways. From the bootloader screen you can use the volume and power buttons to choose “recovery.” Or you can install a third party app such as ROM Toolbox, Power Toggles, or GooManager which gives you the option of rebooting straight into recovery mode — these apps all require root access to do that.
Once you’re in TWRP recovery you can use it to backup your device, restore from a previous backup, wipe your device, flash updates, or make other system-level changes.
Of course, you could also use the multi-tool to automated the process for you a bit, but I like typing some of these commands out by hand, since it can make it a bit easier to keep track of exactly what it is I’m doing to my phone and to troubleshoot problems along the way.
As I mentioned above, the methods I just outlined are just some of the ways to root a Nexus 5, unlock the bootloader, and install a custom recovery. But the whole process is pretty simple and takes about 10 minutes or less (the video above clocks in at less than 7 minutes, but my bootloader was already unlocked when I shot the video retracing my steps, so the actual process may take a bit longer).