Platform: Windows 10 | Device: Google Nexus 5 (hammerhead) | ROM: LineageOS 16.0 (Android 9 Pie)
π΄ ALL DATA ON YOUR PHONE WILL BE ERASED! Back up everything first.
π΄ Follow each step in order. Do NOT skip any step.
π‘ Keep your phone charged to at least 60% throughout the process.
π‘ If something goes wrong, do not panic β you can always reflash.
Download all files before you begin. Save them in a single folder, e.g., C:\Nexus5Flash\
| What | Where to Download |
|---|---|
| β ADB & Fastboot (Platform Tools) | developer.android.com/tools/releases/platform-tools |
| β Google USB Driver | developer.android.com/studio/run/win-usb |
| β TWRP Recovery for Nexus 5 | dl.twrp.me/hammerhead/ β See detailed instructions below β¬οΈ |
| β LineageOS 16 ROM for Nexus 5 | XDA Thread β Download the .zip file |
| β GApps (Google Apps) | MindTheGapps β Pick arm, Android 9.0 |
π‘ Tip: Extract the Platform Tools ZIP into
C:\Nexus5Flash\platform-tools\
β οΈ The official TWRP website (twrp.me/lg/lgnexus5.html) only shows device info and buttons β the actual.imgfile is hosted on a separate download server.
The latest and last official TWRP build for Nexus 5 (hammerhead) is:
File: twrp-3.7.0_9-0-hammerhead.img
You can download it in two ways:
-
π Direct download link: https://dl.twrp.me/hammerhead/twrp-3.7.0_9-0-hammerhead.img
-
π Browse all available TWRP versions for Nexus 5: https://dl.twrp.me/hammerhead/
π΄ Security Warning: Only download TWRP from official TWRP servers (
twrp.meordl.twrp.me). Never download.imgfiles from random third-party sites β they could be tampered with and harm your device.
After downloading, save the file inside C:\Nexus5Flash\ and rename it to:
twrp-3.7.0_9-0-hammerhead.img
- Extract the Google USB Driver ZIP you downloaded.
- Connect your Nexus 5 to the PC via USB.
- Open Device Manager (right-click Start β Device Manager).
- Find your Nexus 5 (may show as "Unknown Device").
- Right-click it β Update Driver β Browse my computer β point to the extracted USB driver folder.
- Click Next and install.
- Press
Windows Key + S, type "Environment Variables", open it. - Under System Variables, find and click "Path" β click Edit.
- Click New and add:
C:\Nexus5Flash\platform-tools - Click OK on all windows.
- Open Command Prompt (press
Win + R, typecmd, press Enter). - Type:
adb version
- You should see something like:
Android Debug Bridge version 1.0.41β
- On your Nexus 5, go to Settings β About Phone.
- Tap "Build Number" exactly 7 times rapidly.
- You'll see: "You are now a developer!" π
- Go back to Settings β Developer Options (now visible at the bottom).
- Turn ON β USB Debugging
- Turn ON β OEM Unlocking
- Connect Nexus 5 to PC via USB.
- On the phone, a popup will appear: "Allow USB Debugging?" β Tap Allow / OK.
- In Command Prompt, type:
adb devices
- You should see something like:
List of devices attached
XXXXXXXX device
β If you see your device listed, you're good!
π΄ This will WIPE all data on the phone! Make sure you've backed up everything.
In Command Prompt, type:
adb reboot bootloader
Your phone screen will show a green Android robot with text. This is Fastboot/Bootloader mode. β
fastboot devices
You should see your device serial number listed. β
fastboot oem unlock
- On the phone screen, use Volume Up/Down to navigate to "Yes" and press the Power button to confirm.
- The phone will wipe itself and reboot. This is normal! β
- Once it reboots to the setup screen, skip setup (don't sign into Google yet).
- Re-enable USB Debugging again (repeat Steps 4 & 5 β the wipe resets all settings).
TWRP is a special recovery mode that lets you install custom ROMs.
adb reboot bootloader
Navigate Command Prompt to your folder first:
cd C:\Nexus5Flash
Then flash TWRP using the exact filename you downloaded:
fastboot flash recovery twrp-3.7.0_9-0-hammerhead.img
You'll see OKAY when done. β
π‘ If you downloaded a different version, replace the filename accordingly.
- On your phone (still in bootloader), use Volume Down to scroll to "Recovery mode".
- Press Power to select it.
- TWRP will launch β a blue/dark interface. β
- If it asks to "Keep System Read Only?" β Swipe to Allow Modifications.
In Command Prompt (while TWRP is open on phone):
adb push C:\Nexus5Flash\lineage-16.0-XXXX-hammerhead.zip /sdcard/
adb push C:\Nexus5Flash\MindTheGapps-9.0.0-arm-XXXX.zip /sdcard/
Wait for both transfers to complete (may take a few minutes). β
π‘ Replace the filenames above with the actual names of the files you downloaded.
- In TWRP, tap Wipe.
- Tap Advanced Wipe.
- Check all of these boxes:
- β Dalvik / ART Cache
- β System
- β Data
- β Cache
- Swipe the bar at the bottom to confirm the wipe.
- Wait until done, then tap Back. β
- In TWRP main menu, tap Install.
- Navigate and select your LineageOS ZIP file.
- Swipe to confirm Flash at the bottom.
- Wait for it to complete. β
- Tap Add More Zips (or go back to Install).
- Select your MindTheGapps ZIP file.
- Swipe to confirm Flash.
- Wait for it to complete. β
- Tap Wipe β Wipe Dalvik / Cache.
- Swipe to confirm.
- Done! β
- In TWRP, tap Reboot β System.
- If it asks "Install SuperSU?" β Tap Do Not Install (unless you want root access).
β³ The first boot takes 5β10 minutes. This is completely normal! Don't panic or reboot during this time.
Once it boots, you'll see the LineageOS setup wizard. Set up your phone like new! π
- Downloaded all required files
- Downloaded TWRP
.imgfromdl.twrp.me/hammerhead/ - Installed ADB, Fastboot & USB Drivers
- Enabled Developer Options & USB Debugging
- Unlocked Bootloader
- Flashed TWRP Recovery (
twrp-3.7.0_9-0-hammerhead.img) - Wiped the phone (Advanced Wipe)
- Flashed LineageOS 16 ROM
- Flashed GApps
- Wiped Dalvik Cache
- First boot successful! π
| Problem | Fix |
|---|---|
adb devices shows nothing |
Re-plug USB, re-approve debugging popup, reinstall USB driver |
fastboot devices shows nothing |
Try a different USB port or cable; reinstall driver via Device Manager |
| Phone stuck on boot logo | Reboot into TWRP, redo Dalvik/Cache wipe, then reboot system |
TWRP .img file not found on twrp.me |
Use the direct link: dl.twrp.me/hammerhead/twrp-3.7.0_9-0-hammerhead.img |
| TWRP not launching after flash | Redo Step 11; make sure you used twrp-3.7.0_9-0-hammerhead.img |
| App says "requires newer Android" | Known limitation β Nexus 5 is hardware-capped at Android 9 |
fastboot oem unlock not working |
Make sure OEM Unlocking is enabled in Developer Options (Step 5) |
| TWRP asks for password on Data | Just tap Cancel β it's an encryption prompt, safe to skip |
- Install LineageOS on hammerhead β LineageOS Wiki
- Using ADB and Fastboot β LineageOS Wiki
- LineageOS 16.0 for Nexus 5 β XDA Forums
- TWRP Device Page for Nexus 5 (hammerhead)
- TWRP Direct Downloads for Nexus 5 (hammerhead)
- MindTheGapps β GApps for Android 9
- Google USB Drivers for Windows
Tutorial compiled by vibs2006 with assistance from GitHub Copilot.
Feel free to share, fork, or improve this guide!
Last updated: February 2026