Skip to content

Instantly share code, notes, and snippets.

@Kyuugeki
Forked from michaeljymsgutierrez/Fastboot_cmd.txt
Created July 12, 2023 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kyuugeki/7a86260ca0a95c05503b81507ead90af to your computer and use it in GitHub Desktop.
Save Kyuugeki/7a86260ca0a95c05503b81507ead90af to your computer and use it in GitHub Desktop.
Fastboot command lines for android
1. Flashing the recovery image:
fastboot flash recovery recovery.img
2. Flash the kernel and bootloader:
fastboot flash boot boot.img
3. Erase a partition:
fastboot erase cache
4. Reboot the phone:
fastboot reboot
5. Boot with a custom built kernel and root filesystem (but not write them into the flash memory):
fastboot boot linux-2.6/arch/arm/boot/zImage root-image/recovery.img-ramdisk.cpio.gz
6. Format partitions:
fastboot format cache
fastboot format userdata
7. Flash all partitions at once:
fastboot -w flashall
8. Restoring from backed up images in the user’s computer::
fastboot erase system
fastboot erase data
fastboot erase cache
and then flash the images (starting with system):
fastboot flash system system.img
fastboot flash data data.img
fastboot flash cache cache.img
9. Boot the phone with a specific linux kernel commandline argument:
fastboot -c "console=ttyHSL0,115200,n8" boot boot.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment