Rooting an Android device allows you to unleash the actual potential of the Android OS. Fastboot, alongside ADB (Android Debugging Bridge), is a very useful command-line tool that Android users utilize to tweak their devices. You have to use it by running Fastboot Commands. Every command is there for a particular function.
Sometimes it gets tough to find the right command for the operation you are performing. It gets a lot easier when you can find all the commands in a single list. That’s why I’m going to share all the Fastboot Commands in this post. You can save this list for any future references.
What is Fastboot?
When it comes to rooting an Android device, ADB and Fastboot are the first names that will pop up in your mind. We have already covered the use of ADB and its commands. Here, we will cover only Fastboot commands, but we will also need ADB in order to execute them. Basically, Fastboot is a command-line tool and an Android OS protocol used to perform various command-line operations.
It is a part of the SDK Platform-tools, just like ADB, and helps in debugging and modifying an Android device using a computer. It acts as a communication bridge between the computer and the Android device. You need to boot the device into the Fastboot or Bootloader mode in order to use these commands. That’s why ADB is essential.
What are Fastboot Commands?
Fastboot Commands are function-specific commands that run into Fastboot or Bootloader Mode. Using them, you can perform various operations on an Android device like enabling/disabling OEM unlock, flashing factory images, modifying partitions, or even rebooting the bootloader. There are many other things you can do as well.
These commands make flashing a custom recovery or stock firmware image on an Android device very simple. You just need to manually execute specific commands and the rest will take place automatically. Earlier, tweaking Android was a task of developers but now anyone can do that.
When to use Fastboot Commands?
You have to use Fastboot CMDs when you are working on Bootloader mode. ADB commands will not work here as the device is not booted into the Android operating system. If you wish to do any operation in this mode, then using the Fastboot commands is the most viable option.
The Android debugging tools need to communicate with the device in order to work. However, Fastboot CMDs can work even if the OS is not booted. You need to boot the device into Bootloader or Fastboot though.
Fastboot Commands List 2021
Here are all the Fastboot commands that you can use to perform a specific task on an Android device. Before using these, you need to make sure of these things:
- ABD and Fastboot are installed on the system as both will be needed.
- You have enabled USB Debugging on your Android device from Developer options.
- Your Android device should be booted into Fastboot mode/Bootloader mode.
After that, you can pick any command from the list and execute it easily.
Show the given bootloader variable:
Queue devices in bootloader (-l: with device paths):
- fastboot devices [-l]
- fastboot reboot [bootloader]
Flash every partition from $ANDROID_PRODUCT_OUT. On A/B devices, the flashed slot is set as active, while the secondary images may be flashed to an inactive slot:
- fastboot flashall
Flash any given partition, using the image from $ANDROID_PRODUCT_OUT if/when no filename is given:
- fastboot flash PARTITION [FILENAME]
Flash every partition using an update.zip package:
- fastboot update ZIP
Commands for Options
Sweep user data:
- fastboot -w
Select a USB device:
- fastboot -s SERIAL
Select a network device:
- fastboot -s tcp|udp:HOST[:PORT]
Distribute into sparse files no larger than SIZE:
- fastboot -S SIZE[K|M|G]
Perform a flash operation forcefully that may be unsafe:
- fastboot –force
Activate SLOT; ‘all’ for both slots, ‘other’ for non-current slot (default is the current active slot):
- fastboot –slot SLOT
Selects the active slot before rebooting:
- fastboot –set-active[=SLOT]
Prevent flashing secondary slots in flashall/update:
- fastboot –skip-secondary
Prevent rebooting the device after flashing:
- fastboot –skip-reboot
Select disabled-verity when flashing vbmeta:
- fastboot –disable-verity
Select disable-verification when flashing vbmeta:
- fastboot –disable-verification
Activate file-based encryption, sweeping user data:
- fastboot –wipe-and-use-fbe
Stop buffering of input or output:
- fastboot –unbuffered
Verbose an output:
- fastboot –verbose, -v
- fastboot –version
Display this message:
- fastboot –help, -h
Boot Image Commands
Complete the Downloading and booting of kernel from RAM:
- fastboot boot KERNEL [RAMDISK [SECOND]]
Make a boot image and flash it:
- fastboot flash:raw PARTITION KERNEL [RAMDISK [SECOND]]
Choose path to DTB for boot image header version 2:
- fastboot –dtb DTB
Reject kernel command line:
- fastboot –cmdline CMDLINE
Choose kernel base address (default: 0x10000000).
- fastboot –base ADDRESS
Choose kernel offset (default: 0x00008000):
- fastboot –kernel-offset
Select ramdisk offset (default: 0x01000000):
- fastboot –ramdisk-offset
Select tags offset (default: 0x00000100):
- fastboot –tags-offset
Choose dtb offset (default: 0x01100000):
- fastboot –dtb-offset
Choose flash page size (default: 2048):
- fastboot –page-size BYTES
Select boot image header version:
- fastboot –header-version VERSION
Select boot image OS version (default: 0.0.0):
- fastboot –os-version MAJOR[.MINOR[.PATCH]]
Choose boot image OS security patch level:
- fastboot –os-patch-level YYYY-MM-DD
Commands For Locking/Unlocking
Lock or unlock partitions to flash them:
- fastboot flashing lock|unlock
Lock or unlock the significant bootloader partitions:
- fastboot flashing lock_critical|unlock_critical
Detect if unlocking is allowed (1) or not(0):
- fastboot flashing get_unlock_ability
Manul Commands For Android Things
Move the given file to the stage for the next command:
- fastboot stage IN_FILE
Script data staged by the last command to a file:
- fastboot get_staged OUT_FILE
Clean a flash partition:
- fastboot erase PARTITION
Reset a flash partition:
- fastboot format[:FS_TYPE[:SIZE]] PARTITION
Select the active slot:
- fastboot set_active SLOT
Run OEM-specific command:
Clear or deactivate a GSI installation (fastbootd only):
- fastboot gsi wipe|disable
Clean or Wipe the super partition. Doing this will reset it to having an empty set of default dynamic partitions:
- fastboot wipe-super [SUPER_EMPTY]
Cancel an in-progress update (For devices that feature snapshot-based updates):
- fastboot snapshot-update cancel
Finish an in-progress update if it is in the “merging” phase (For devices that feature snapshot-based updates):
- fastboot snapshot-update merge
Fastboot commands allow you to tweak the Android device even when the OS isn’t booted. You have to boot into Fastboot or Bootloader mode in order to run them. Once you are in, you can perform any operation using its specific command. You just need to finalize an operation and execute its command in the Command Prompt.
These are all the Fastboot commands available functioning of now. You can freely put a bookmark on this list and keep using it while customizing your Android device.