Install Android L on Nexus: Fastboot Guide
In this article
This guide walks you through installing Android L (the developer preview of Android 5.0 Lollipop) on a supported Nexus device using the fastboot method. Fastboot is a command-line tool that flashes system images directly to your device's partitions. You'll need a computer (Windows, Mac, or Linux), a USB cable, and your Nexus device. This process will erase all data on your device, so back up anything important first.
What You'll Need
- A supported Nexus device (Nexus 5, Nexus 7 2013, or Nexus 10 for the original Android L preview).
- A computer with Android SDK Platform Tools installed (includes fastboot and adb).
- The Android L factory image for your specific device model, downloaded from Google's developer website.
- A USB cable that supports data transfer (not just charging).
- Your device's bootloader unlocked. If it isn't, you'll need to unlock it first (this wipes your device).
- Backup of all personal data (photos, contacts, etc.) because flashing will erase everything.
Step-by-Step
- Back up your data. Since flashing wipes your device, copy any photos, documents, or other files to your computer or cloud storage. Also, ensure your Google account sync is up to date for contacts and calendar.
- Enable Developer Options and USB Debugging. On your Nexus, go to Settings > About phone (or About tablet) and tap Build number seven times. You'll see a message that you're now a developer. Then go to Settings > Developer options and turn on USB debugging.
- Install the Android SDK Platform Tools. Download the official Platform Tools zip from the Android developer site, extract it to a folder on your computer (e.g.,
C:\platform-toolson Windows, or~/platform-toolson Mac/Linux). This folder containsfastbootandadbexecutables. - Download the Android L factory image. Go to the Android developer's factory images page and download the correct image for your device model (e.g., "hammerhead" for Nexus 5). Extract the downloaded ZIP file. Inside, you'll find a folder with files like
image-hammerhead-lpx13d.zipand aflash-all.bat(Windows) orflash-all.sh(Mac/Linux) script. - Unlock the bootloader (if not already). Power off your device. Press and hold Volume Down + Power to boot into the bootloader. Connect your device to your computer via USB. Open a command prompt or terminal in the platform-tools folder. Type
fastboot devicesto confirm your device is recognized (you should see a serial number). If your bootloader is locked, typefastboot oem unlock(on Nexus 5/7/10) and confirm on the device screen. This wipes your device. Once unlocked, you can proceed. - Run the flash script (easiest). With the device still in bootloader mode, run the
flash-all.bat(Windows) orflash-all.sh(Mac/Linux) script from the extracted factory image folder. This will flash the bootloader, radio (if applicable), and system images automatically. Wait for the process to complete; it may take several minutes. - If the script fails, flash manually. If the script errors out, you can flash each partition manually. In the same folder, extract the
image-*.zipfile. Then, in the bootloader, run these commands one by one:
fastboot flash bootloader bootloader-*.img
fastboot reboot-bootloader
fastboot flash radio radio-*.img(only if your device has a radio, e.g., Nexus 5)
fastboot reboot-bootloader
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot erase cache(if you don't have a cache.img)
fastboot reboot - Wait for the device to boot. The first boot after flashing can take 5–10 minutes. Be patient. Once it boots, you'll see the Android setup screen. Complete the setup as usual.
Common Mistakes
- Using the wrong factory image. Each Nexus model has a specific image. Flashing a wrong one can brick your device. Always double-check the device codename (e.g., hammerhead for Nexus 5, flo for Nexus 7 2013 WiFi).
- Not unlocking the bootloader first. If you skip step 5, fastboot will fail with "FAILED (remote: not allowed)". You must unlock before flashing.
- USB driver issues (Windows). Windows often needs the Google USB driver installed. Without it, fastboot won't recognize your device. Install the driver from the SDK Manager or the Google USB Driver page.
- Running the script from the wrong directory. The flash-all script expects to be run from the folder containing the image files. If you run it from elsewhere, it won't find the files.
- Interrupting the flash. Do not unplug the USB cable or close the command window during flashing. This can leave your device in a broken state.
Tips
- Keep the command window open until you see "OKAY" or "Finished" messages. If you see "FAILED", note the error message – it often tells you what went wrong.
- Use a short USB cable and a USB port directly on your computer (not a hub) to avoid connection drops.
- If you want to keep your data, you can try the "dirty flash" method (skip the
fastboot flash userdatastep), but this is risky and can cause crashes. A clean install is recommended. - After flashing, you may need to re-enable USB debugging in Developer Options if you want to use adb again.
- Write down your device's serial number (from
fastboot devices) in case you need to identify it later.
Troubleshooting
If the device is stuck in a boot loop or won't boot:
- Reboot into the bootloader (hold Volume Down + Power).
- Connect to your computer and run the flash script again. Sometimes a second attempt works.
- If that fails, try a factory reset from the bootloader: use the volume keys to select "Recovery mode", then choose "Wipe data/factory reset". This will erase your data but may fix the boot loop.
- If still stuck, re-download the factory image (it may have been corrupted) and try again.
If fastboot says "device not found":
- Check the USB connection – try a different port or cable.
- On Windows, reinstall the Google USB driver.
- Make sure your device is in bootloader mode (not just plugged in normally).
- Try running
fastboot devicesagain. If nothing shows, your drivers are the issue.
If the script fails with "cannot load 'system.img'":
This usually means you're running the script from the wrong folder. Navigate to the folder containing the extracted image files (where system.img is located) and run the script from there.
Frequently Asked Questions
Will this wipe my data?
Yes, unlocking the bootloader and running the flash-all script will erase everything on your device. Back up before starting.
Can I go back to the previous Android version after installing Android L?
Yes, you can flash the factory image of the previous Android version (e.g., Android 4.4 KitKat) using the same fastboot method. Just download the appropriate factory image and follow the same steps.
Is Android L the same as Android 5.0 Lollipop?
Yes, Android L was the developer preview name, and the final release was called Android 5.0 Lollipop. This guide is for the preview version, but the flashing method works for any official factory image.
Do I need to root my device first?
No, rooting is not required. Fastboot flashing works on a stock device with an unlocked bootloader.
What if my device is not supported?
This guide only works for Nexus devices that have an official Android L preview image (Nexus 5, Nexus 7 2013, Nexus 10). Other devices cannot use this method.
Why does my device show "untrusted" after flashing?
That message appears when the bootloader is unlocked. It's normal and just a warning. You can relock the bootloader after flashing (using fastboot oem lock) to remove it, but that will wipe your device again.