{"id":2093,"date":"2024-10-31T13:39:18","date_gmt":"2024-10-31T13:39:18","guid":{"rendered":"https:\/\/meghtechnologies.com\/blog\/?p=2093"},"modified":"2025-01-07T07:44:41","modified_gmt":"2025-01-07T07:44:41","slug":"fastboot-mode-commands-with-examples","status":"publish","type":"post","link":"https:\/\/meghtechnologies.com\/blog\/fastboot-mode-commands-with-examples\/","title":{"rendered":"Android Fastboot Mode Commands with Examples"},"content":{"rendered":"\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td>Unlock Bootloader:<\/td><td>fastboot oem unlock<\/td><td>(Allows flashing of custom images. Some devices may require additional steps or confirmation.)<\/td><\/tr><tr><td><\/td><td>fastboot flashing unlock<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Lock Bootloader:<\/td><td>fastboot oem lock<\/td><td><\/td><\/tr><tr><td><\/td><td>fastboot flashing lock<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Flash Recovery:<\/td><td>fastboot flash recovery &lt;filename&gt;.img<\/td><td>(Replaces the current recovery with a new one, usually a custom recovery like TWRP.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Flash System Image:<\/td><td>fastboot flash system &lt;filename&gt;.img<\/td><td>(Flashes a new system image, often used to install a new OS version or custom ROM.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Reboot Device:<\/td><td>fastboot reboot<\/td><td>(Restarts the device normally.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Reboot to Fastboot:<\/td><td>adb reboot fastboot<\/td><td>(Reboots the device into fastboot mode.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Reboot to Recovery:<\/td><td>fastboot reboot recovery<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Erase Partition Data:<\/td><td>fastboot erase &lt;partition&gt;<\/td><td>(Clears data from a specific partition, like userdata, cache, etc.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Format Partition:<\/td><td>fastboot format &lt;partition&gt;<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Check Device Connection:<\/td><td>fastboot devices<\/td><td>(Lists devices connected in fastboot mode.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Get Device Information:<\/td><td>fastboot getvar all<\/td><td>(Displays detailed device information like serial number, hardware info, etc.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Flash Specific Partitions (e.g., Bootloader, Radio):<\/td><td><\/td><td><\/td><\/tr><tr><td>Bootloader:<\/td><td>fastboot flash bootloader &lt;filename&gt;.img<\/td><td><\/td><\/tr><tr><td>Radio (for devices with separate radio firmware):<\/td><td>fastboot flash radio &lt;filename&gt;.img<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Boot an Image Temporarily (without Flashing):<\/td><td>fastboot boot &lt;filename&gt;.img<\/td><td>(Boots an image without flashing it, useful for testing custom recoveries or kernels.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Set Active Slot (for devices with A\/B Partitions):<\/td><td>fastboot &#8211;set-active=&lt;slot&gt;<\/td><td>(Sets the active partition slot to either a or b.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Flash Multiple Partitions at Once:<\/td><td>fastboot -w update &lt;filename&gt;.zip<\/td><td>(Flashes all partitions listed in a specified update package, typically used for full OTA updates.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Display Variable Information (like current slot or partition layout):<\/td><td>fastboot getvar &lt;variable&gt;<\/td><td>(Examples of &lt;variable&gt;: current-slot, partition-size:&lt;partition&gt;, version-bootloader, version-baseband.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Resize a Partition (for devices that support it):<\/td><td>fastboot resize-partition &lt;partition&gt; &lt;size&gt;<\/td><td>(Resizes a specified partition to a new size. Requires compatible firmware and device support.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Erase Specific User Data (Useful for a Factory Reset):<\/td><td>fastboot -w<\/td><td>(Performs a full wipe of userdata and cache partitions.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Enable\/Disable Verity (used for device integrity checks):<\/td><td><\/td><td><\/td><\/tr><tr><td>To disable:<\/td><td>fastboot disable-verity<\/td><td><\/td><\/tr><tr><td>To enable:<\/td><td>fastboot enable-verity<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Reboot to Bootloader (Useful if chaining commands):<\/td><td>fastboot reboot bootloader<\/td><td>(Restarts the device back into bootloader mode without fully booting it up.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Flash a Partition with Sparse Images:<\/td><td>fastboot flash &lt;partition&gt; &lt;filename&gt;.img_sparsechunk&lt;N&gt;<\/td><td>(Flashes a sparse image chunk by chunk. Often used with images for Moto and Nexus devices.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Erase Cache Partition:<\/td><td>fastboot erase cache<\/td><td>(Clears the cache partition, sometimes useful for fixing boot issues.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Continue Boot (Use if Boot Process is Paused by Bootloader):<\/td><td>fastboot continue<\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>OEM Commands (Device-Specific):<\/td><td>fastboot oem &lt;command&gt;<\/td><td>(For example, fastboot oem unlock-critical to unlock additional partitions on some devices.)<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>Bootloader Lock Status Check:<\/td><td>fastboot getvar unlocked<\/td><td>(Checks if the bootloader is currently locked or unlocked.)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><a href=\"https:\/\/meghtechnologies.com\/blog\/custom-android-app-development-company\/\">For More On Android App Development Visit our Page here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unlock Bootloader: fastboot oem unlock (Allows flashing of custom images. Some devices may require additional steps or confirmation.) fastboot flashing unlock Lock Bootloader: fastboot oem lock fastboot flashing lock Flash Recovery: fastboot flash recovery &lt;filename&gt;.img (Replaces the current recovery with a new one, usually a custom recovery like TWRP.) Flash System Image: fastboot flash system [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[808],"class_list":["post-2093","post","type-post","status-publish","format-standard","hentry","category-android-apps","tag-android-apps"],"_links":{"self":[{"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/2093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":3,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"predecessor-version":[{"id":2097,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/2093\/revisions\/2097"}],"wp:attachment":[{"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meghtechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}