But anyway, the only effort that the user has to exert in all of these is simply hitting the Install button in the initial phase and the Reboot button in the latter half. However, with the open-source nature of Android, things aren’t so plain and simple. Most of the users go ahead and try out tons of customizations and tweaks. These include the ability to flash custom ROMs, a custom recovery like TWRP, unlock their device bootloader, try out Build. Prop Tweaks, flashing mods from Magisk, and Frameworks of Xposed among others. And while executing the above steps, there’s always a possibility of things going south. Just a slight miss-step and you will end up with a bootloop or a soft-bricked device. The worst-case scenario will lead to a hard-brick, in which case you will have to take up the EDL Mode route to repair your device. All in all, as and when you end up messing up your device, the first thing that comes to your mind is flashing the stock firmware to make it work back again. But unfortunately, things in a bricked or boot-looped device works in a slightly different way. Since you cannot access the Android system, you cannot simply install the stock ROM in the “normal” way. Fortunately, there still exists a handy way of doing so. You could still flash the stock firmware of any Android device using fastboot commands. The process is applicable for near about every device running on any chipset (Exynos, Snapdragon, or MediaTek) and of any OEM. So without further ado, here are all the required instructions set. Editor’s Choice
How to Install OTA Updates in Rooted Android DeviceHow to Permanently Install TWRP without TWRP ZIP File (only using TWRP.img file)Root Android Devices Without TWRP Recovery[GUIDE] Flash ROMs/Magisk/TWRP/Kernels on A/B Partition Devices
How to Flash Stock Firmware via Fastboot Commands
We are breaking down the entire instructions into simpler steps. Make sure to follow them in the same manner. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.
STEP 1: Download Android SDK Platform Tools
First and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform-tools folder, which will be used throughout this guide.
STEP 2: Boot your device to Fastboot Mode
Next up, you will have to boot your device to Fastboot, or as some OEMs like to call, the Bootloader menu. There are two ways of doing so- via hardware key combinations or using ADB Commands. If your device is in a perfectly working condition, then you could use either of the two methods (though we would recommend opting for the Fastboot Commands). On the other hand, if your device is stuck in the bootloop/softbrick state and you cannot access the OS, then you have no choice but to go with the hardware key combination method. So without any further ado, let’s check out both these methods (For detailed instructions, you should also refer to our guide on How to Boot any Android Device to Fastboot Mode).
Method 1: When the Device is working normally
If your device is working well and good, then it is advised that you opt for this ADB Command method to boot your device to Fastboot Mode. This is because it is the universal method that works across all Android devices.
Method 2: When Device is Stuck in Bootloop/Bricked
If you cannot access the OS, then you wouldn’t be able to enable USB Debugging. As a result, you wouldn’t be able to execute the adb reboot bootloader command and you would instead have to opt for the hardware key combinations. Now, there doesn’t exist any universal method to do so, but here are the generic instructions that work for most devices:
STEP 3: Download and Extract Stock Firmware
The next step involves downloading the stock firmware. For that, you could refer to your device’s software download page. There might be other third-party sites as well, but they don’t usually have the updated software package. So the official one is the recommended one. Once you have downloaded it, extract it inside the folder where the Android SDK Platform Tools are installed.
That is, extract it inside the platform-tools folder. However, nowadays, most OEMs pack their firmware under separate packages. For example, OnePlus and Asus use the payload.bin file, Realme and Oppo use OZIP, LG uses KDZ or DZ format, and so on. So please refer to our below-linked guide to extract the firmware corresponding to your device:
How to Extract payload.bin and get the stock boot image fileHow to Extract KDZ, TOT, or DZ LG FirmwareExtract Fastboot Images from Realme/Oppo OZIP FirmwareHow to Extract Sony Boot.sin and get the Stock Firmware FilesHow to Extract Motorola PAC Firmware using SPD Flash Tool
Once you have extracted the firmware and got hold of the Fastboot IMG files, proceed with the below manual steps or directly jump over to the list of device-specific Fastboot commands section: Fastboot Command Sheet For Various Android Devices. Don’t Miss
[GUIDE] Flash ROMs/Magisk/TWRP/Kernels on A/B Partition DevicesEverything About Magisk- Manager, Modules, and MoreHow to Install TWRP Recovery on AndroidHow to Fix FAILED (remote: unknown command) Error
STEP 4: Flash Stock Firmware via Fastboot
NOTE: This is a manual method to create the Fastboot Commands for your device. Carrying it out would require your precious time, in some cases, even up to 30 minutes. However, if you don’t have much time in hand, then I have also automated the process for most of the Android devices and have also created a sample Fastboot Commands sheet that covers most of the devices. So you could also refer to that as well if you don’t wish to manually carry out this task as of now. Here’s the direct link for both these guides: That is it. You have successfully flashed the stock firmware manually via the fastboot commands. A huge kudos to you as you have created the entire code-sheet yourself. With that said, we get it that not all OEMs are so developer-friendly, and as a result, you might face issues getting your hand with the XML file. If that is the case, then below we have attached a few sample fastboot commands to flash stock firmware files, that may come in handy. If that doesn’t work out, the comments section is all yours. Drop-in your device name, the firmware version, and the region as well. If possible please download the entire firmware and send us the screenshot of the same (upload to Imgur, Google Photos, etc and share the link with us in the comments). We will try our best to create the fastboot commands for your device’s stock firmware and then share it with you, either on your email or right here in the comments section.
Unbrick Samsung Devices via Odin
If you have a Samsung device, then you wouldn’t be able to unbrick it via Fastboot Commands. Rather you would need the Odin Tool installed on your PC. After that, you need to download the firmware via Frija Tool or SamMobile site and load it to Odin. Finally, you will have to boot your device to Download Mode and then flash the firmware via Odin. All this has been explained in our detailed guide, do refer to it: Unbrick Samsung | Flash Stock Firmware via Odin.
Fastboot Unbrick Commands Guides For Various Android Devices
Here is a sample fastboot command sheet. I tried to write down the commands for all frequently used files. The below commands are for A/B partition devices, if your device just has a single partition, you will have to ignore the ‘a’ or ‘b’ keywords. For example, fastboot flash dtb_a dtb.img will change to fastboot flash dtb dtb.img.
Fastboot Commands to Unbrick Pixel Devices
Restore Pixel/XL to Stock Firmware via Fastboot | Unbrick itHow to Restore Pixel 2/XL to Stock Firmware via Fastboot | Unbrick itRestore Pixel 3/3 XL/3a/3a XL to Stock Firmware via Fastboot | Unbrick itRestore Pixel 4/XL/4a to Stock Firmware via Fastboot | Unbrick itHow to Restore Google Pixel 5 to Stock Firmware via Fastboot | Unbrick itHow to Flash Pixel 5A Firmware via Fastboot Commands | Unbrick ItHow to Unbrick Google Pixel 6/Pro via Fastboot Commands
Fastboot Commands to Unbrick OnePlus Devices
Restore OnePlus 6/6T to Stock via Fastboot CommandsRestore OnePlus 7/7T/7T Pro to Stock via Fastboot CommandsHow to Restore OnePlus 8/8T/8 Pro to Stock via Fastboot CommandsRestore OnePlus Nord to Stock via Fastboot CommandsHow to Unbrick OnePlus 9/Pro via Fastboot CommandsHow to Unbrick OnePlus Nord N10 5G via Fastboot Commands
Fastboot Commands to Unbrick Xiaomi/Redmi/Mi/Poco Devices
How to Unbrick Xiaomi Mi A1 via Fastboot CommandsHow to Unbrick Xiaomi Mi A2 via Fastboot CommandsUnbrick Xiaomi Mi A3 via Fastboot CommandsHow to Unbrick Redmi Note 7/7S via Fastboot CommandsHow to Unbrick Redmi Note 7 Pro via Fastboot CommandsUnbrick Redmi Note 8 via Fastboot CommandsHow to Unbrick Redmi Note 8 Pro via Fastboot CommandsHow to Unbrick Redmi Note 9 via Fastboot CommandsUnbrick Redmi Note 9 Pro via Fastboot CommandsUnbrick Redmi Note 10 Pro/Pro Max via Fastboot CommandsHow to Unbrick Redmi K20/Pro via Fastboot CommandsUnbrick POCO X2 (phoenixin) via Fastboot CommandsHow to Unbrick Redmi Note 11 via Fastboot CommandsUnbrick Redmi Note 11 Pro/Pro+ via Fastboot CommandsHow to Unbrick Redmi K40 via Fastboot CommandsUnbrick Poco X3 Pro via Fastboot CommandsHow to Unbrick Poco F3 via Fastboot CommandsHow to Unbrick Poco M4 Pro via Fastboot Commands
Unbrick Realme Devices via Fastboot Commands
How to Unbrick Realme X50/ X50 Pro via Fastboot CommandsUnbrick Realme X3 SuperZoom via Fastboot CommandsHow to Unbrick Realme X2/X2 Pro via Fastboot CommandsHow to Unbrick Realme XT via Fastboot CommandsUnbrick Realme C11 via Fastboot CommandsHow to Unbrick Realme 6 Pro via Fastboot CommandsHow to Unbrick Realme 5 Pro/5s/5i via Fastboot CommandsUnbrick Realme 3 Pro via Fastboot CommandsHow to Unbrick Realme 1 via Fastboot CommandsHow to Unbrick Realme 6/6I/6S via SP Flash Tool | Bring it back from Dead
Unbrick Oppo Devices via Fastboot Commands
How to Unbrick any Oppo Reno Device via Fastboot CommandsHow to Unbrick Oppo Find X Series via Fastboot CommandsUnbrick Oppo A series via Fastboot CommandsHow to Unbrick Oppo F Series via Fastboot CommandsHow to Unbrick Oppo R Series via Fastboot Commands
Fastboot Commands to Unbrick Motorola Devices
How to Install Stock Firmware on Motorola G8 Power Lite via Fastboot CommandsInstall Stock Firmware on Motorola G Stylus via Fastboot CommandsInstall Stock Firmware on Motorola G8 Power via Fastboot CommandsHow to Install Stock Firmware on Motorola One Macro via Fastboot CommandsInstall Stock Firmware on Motorola One Zoom via Fastboot CommandsHow to Flash or Install Stock Firmware on Motorola One Hyper via Fastboot CommandsHow to Install Stock Firmware on Motorola One Vision via Fastboot CommandsInstall Stock Firmware via Fastboot Commands on Motorola One Action.How to Unbrick Moto G7/ G7 Plus via Fastboot CommandsHow to Unbrick Moto G9 Play via Fastboot Commands
If your device is not part of this list, then please let me know in the comments section below. In the meantime, you could also make use of the below command sheet. Just extract your device’s firmware inside the platform-tools and verify the files that it has. Then use the commands for those sets of files from here.
Fastboot Commands Sheet to Flash Stock Firmware
Here is a sample fastboot command sheet. I tried to write down the commands for all frequently used files. These commands are not for any particular device nor in any particular order. It could come in handy if you wish to flash a file but aren’t sure of that file’s associated fastboot command. Likewise, you could also just download the stock firmware, and rather than extracting and creating the fastboot commands from the XML File, you could refer to the fastboot commands from below and then flash the files using these commands. Moreover, if you want to flash a file to both the partition, then make sure to specify the partition in the commands as well. For example, if you wish to flash the boot.img to Partition A and B, then the command will be fastboot flash boot_a boot.img and fastboot flash boot_b boot.img. Likewise, you may modify the rest of the commands accordingly, if required. Or ask me via the comments section below. So this is all from this guide on how to flash stock firmware via fastboot commands. Feel free to drop your queries in the comments section below! Apart from the Fastboot Commands method that we have just concluded, there do exist a couple of other methods through which you could flash the stock firmware on your Android device. These are the ADB Sideload and OEM-specific Tool methods. In the ADB Sideload method, you don’t even need to unlock the device’s bootloader and in most cases, it wouldn’t even wipe your data. However, this method is known to work mostly in the stock environment, such as when you are installing OTA updates on your stock device. Though you could still try out this method in bootloop or bricked device, the only prerequisite is that you should boot your device to Stock Recovery or TWRP Recovery. So if you are willing to try out this method, then you may check out our comprehensive tutorial on How to Use ADB Sideload in Android [Stock and TWRP Recovery]. The other method to flash firmware is via OEM-specific Flash Tool. These include the likes of Mi Flash Tool for Xiaomi devices or Android Flash Tool for Pixel devices. All the tools, irrespective of the device you own, would require your device’s bootloader to be unlocked. This is because these tools will be flashing the partition files to their slots via Fastboot Commands (something that we did manually in the Fastboot Commands method).
And whenever there is flashing takes place, you need to have an unlocked bootloader. Moreover, these tools could also be used in custom development. So you could use these tools to fix bootloop or soft-bricked devices. To try it out, you could refer to our guides corresponding to your devices:
How to Flash Firmware on Pixel via Android Flash ToolInstall MIUI Fastboot ROM in Xiaomi, Mi, Redmi, Poco DevicesUnbrick Motorola and Fix Start-Up Failed without using Lenovo Motorola Smart Assistant