NOTE: You need to be bootloader unlocked in order to flash a factory image!
Download the Lollipop Factory Image from here
https://dl.google.com/dl/android/aosp/hammerhead-lrx21o-factory-01315e08.tgz
Save the factory image to your desktop (easiest to find).
Extract the file using WinRAR, 7zip, Winzip or whatever you prefer for extracting files.
Boot your N5 into the bootloader. (Power off then press and hold Volume Down and Power Button)
Connect your phone to your PC.
Inside the folder of the factory image, double click the "flash-all.bat" NOTE: THIS WILL WIPE DATA AND INTERNAL STORAGE!!!
Wait for the command prompt to prompt you to "click any key to exit." Meaning it's finished.
First boot may take up to 10 minutes.
Download Chainfire's AutoRoot from here:
http://download.chainfire.eu/363/CF-Root/CF-Auto-Root/CF-Auto-Root-hammerhead-hammerhead-nexus5.zip
Extract zip to desktop
Ensure that you are in the bootloader and connect your phone to your PC.
Open the Auto Root folder and double click the "Root-Windows.bat" and let it run.
Phone will reboot with root, and will have SuperSU installed.
(For these steps, you must have Java installed)
Boot phone into the bootloader and connect phone to PC.
Download the adb files you need here:
http://dottech.org/downloads/adb_fastboot_and_other_tools.zip?68a68a
Extract the zip to your desktop
Download your recovery of choice. I suggest TWRP which can be found here:
http://techerrata.com/file/twrp2/hammerhead/openrecovery-twrp-2.8.1.0-hammerhead.img
Rename the recovery image to "recovery.img" and place it in the adb_fastboot_and_other_tools\adb_fastboot_and_other_tools\Android folder you just extracted.
Right click that folder and select "Open command prompt here"
In the command prompt, type the following
Code:
fastboot flash recovery recovery.img
Note: This guide may seem a little lengthy and redundant but I posted it for a reason. This guide is broken down "barney style" for everyone out there that wants to know the EXACT steps to installing Lollipop, rerooting and reflashing recovery. This may not be the easiest or fastest method to do any of this, but it's the way I do it and it's pretty fast. If you have any questions, please post them below and I will do my best to answer them all in a timely manner. Thanks and enjoy Lollipop!!
If you do not have the Nexus 5 drivers installed, please follow the first 7 steps found here: http://www.technobuzz.net/install-nexus-5-driver-adb-fastboot-unlock-bootloader/
If I helped you out, please click the "Thanks" button to show your appreciation.
Last edited: