Fastboot is a command line tool used to directly flash the filesystem in Android devices from a host via USB. It allows flashing of unsigned partition images. It is disabled in production devices since USB support has been disabled in the bootloader. You must have an Engineering SPL, or an SPL that is S-OFF.
Verify SPL S-OFF
With the exception of the Google Nexus One (which has an OEM unlock), when you boot the device into the bootloader, you should see S-OFF (security off) on the top line. If you see S-ON, or you see a four-color rainbow background, the SPL does not support fastboot. You will need to install a fastboot compatable SPL, such as HardSPL or any of the Engineering SPLs for various devices. See the device specific page for further instructions.
- Make sure you have ADB or the SDK installed.
- Download fastboot for the appropriate operating system for your computer.
- Place the executable in the proper place, usually:
- Linux: ~/android_sdk/tools/ or ~/bin/
- OS X: ~/android-sdk-macosx/platform-tools/
- Windows: C:\android-sdk-windows\tools
- Turn off the device.
- Boot device into bootloader
- Make sure the device is in FASTBOOT and not HBOOT
- Connect the device to the computer via USB.
- On your computer, open terminal and run (you may need elevated privileges for this):
- You should see something similar to:
List of devices attached HTXXXXXXXXXX device
Typical Partition Layout
For Reference when flashing partitions
|Name||Nandroid .img||Information Contained||Mount Point||Notes|
|splash1||N/A||Boot image ("T-mobile G1" image)||mtdblock0?||size: 320x480x2. Different from bootanimation.zip.|
|recovery||N/A||A 'backup' kernel, initrd, and OS
for system recovery / maintenance
|mtdblock1||Can flash custom recovery.img (Amon_Ra, ClockworkMod, etc). |
Accessed by holding [home] while booting.
|boot||boot.img||The main kernel and initrd||mtdblock2||Can flash custom boot.img|
|system||system.img||The main OS||mtdblock3||This is the /system partition|
|cache||cache.img||Temp storage||mtdblock4||Unused. Can be re-partitioned.|
|userdata||data.img||User data and settings||mtdblock5||This is the /data partition|
Manual Nandroid restore
Make a Nandroid backup, and copy the folder off your SD card to your desktop.
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash boot boot.img
Flash Custom Recovery.img
fastboot flash recovery /path/to/<recovery>.img
Flash Custom boot.img
You should make a Nandroid backup first, in case you need to recover your boot.img
fastboot flash boot /path/to/<boot>.img
If you are developing a kernel, you may find it helpful to delete your boot.img and recovery.img to force booting into fastboot:
fastboot erase boot
fastboot erase recovery
You can then manually boot from your custom kernel and a ramdisk:
fastboot boot <kernel> <ramdisk>
Once you have a working kernel and ramdisk, you can automagically combine them within fastboot:
fastboot flash:raw boot <kernel> <ramdisk>