In this guide, we will show you the steps to restore Google Pixel 5 device to stock firmware via Fastboot Commands and then unbrick it. The latest addition to the Pixel family, the fifth iteration came with a lot of surprises. This time the Silicon Valley giants decided to make a shift from being among the top-end flagships. Rather it has settled in the mid-range segment and as of now, there doesn’t seem to any complaint as such.
Granted you aren’t getting the Snapdragon 865+ chipset and have to settle for Snapdragon 765G, but the users who prefer to buy the Pixel devices aren’t the hardcore gamers either. It mostly caters to those set of users who are looking for an all-rounder device that tick marks all the requirements for everyday usage. In this regard, the Pixel 5 manages to pass out in flying colors. There’s not much to write about the camera as they are always been the absolute best and the same has been the case this time as well.
Plus the company has also kept the latest iteration pretty simple- just a single variant and a single color. With that said, the device has also continued its legacy of being among the most active players in custom development. There are already a plethora of tweaks and custom binaries available for these devices. So for the tech enthusiasts who have unlocked their bootloader, there’s a plentitude of mods waiting for you. But at the same time, all this might prove to be risky as well.
If you don’t end up executing the flashing steps correctly or flash the file to the incorrect partition, then you are inviting risks. These might include a soft-brick, bootloop, or even a hard-brick. But even f that happens, there is a handy way out. In fact, there are two different ways out! And in this guide, we have shared both. So without further ado, let’s get on with the guide to restore Google Pixel 5 device to stock firmware via Fastboot Commands and unbrick it.
- How to Root Google Pixel 5 via Magisk without TWRP (Android 11)
- How to Pass Magisk SafetyNet on Rooted Android 11
- Root Android 11 via Magisk Patched boot.img (without TWRP)
- Fix Magisk patched boot.img issue while Rooting Android 11
Restore Google Pixel 5 to Stock Firmware via Fastboot and Unbrick it
The below instructions have been written under separate sections for ease of understanding. Proceed ahead in the exact same sequence as mentioned. Furthermore, make sure to checkmark all the requirements mentioned below and only then proceed with the instructions. 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: Unlock Bootloader of Pixel 5
To begin with, your device’s bootloader should be unlocked. Well, this might already be the case for most of our readers otherwise chances of a bootloader locked device getting bricked is very rare. An unlocked bootloader is required so that you would be able to flash the image files (.img) to their respective partitions via the Fastboot Commands or the script file. However, if that is not the case, then refer to our detailed guide on How to Unlock the Bootloader Of Google Pixel Devices.
STEP 2: Install ADB and Fastboot
Next up, download and install the Android SDK Platform Tools on your PC. This will provide you with the necessary ADB and Fastboot binaries.
STEP 3: Download Pixel 5 Stock Firmware
Finally, download the stock firmware for your device (these are the complete factory images and not the OTA file because OTAs wouldn’t work in this current scenario):
These are the latest version at the time of publishing this guide. To check for newer builds, head over to Google’s Factory Images page and scroll to the “redfin” for Pixel 5 section. Once you have downloaded the latest firmware, proceed ahead with the steps to restore Pixel 5 to stock firmware via Fastboot Commands and then unbrick it.
STEP 4: Extract Pixel 5 Stock Firmware
Now that you have downloaded the firmware, extract it to a convenient location on your PC. Once you do so, you should get a bootloader.img file, three flash files, a radio.img file and a compressed folder with partition images (see the second image).
Furthermore, this second compressed folder will have other image files such as the modem, system, vendor, boot, etc. You should not extract this ZIP file. This is because we would be flashing this ZIP file as it is.
Now there are two different approaches that you take while flashing the firmware. You could either use the flash-all script that will automatically flash all the files. If that doesn’t work out, then you could manually flash the IMG files to its partition. We have shared both these methods to restore your Pixel 5 to stock firmware via Fastboot Commands and then unbrick it. You may refer to the one that meets your requirements.
- Fix error boot prepare- device stuck in fastboot (Pixel devices)
- How to Uninstall TWRP and Restore Stock Recovery on Android
- How to Uninstall Magisk Modules using TWRP Recovery
- Steps to Uninstall Magisk Modules using TWRP Recovery
STEP 5A: Restore Pixel 5 to Stock Firmware via Flash-All Script
The flash-all script file consists of a command that will wipe off all the data on your device. As of now, your device is stuck in a bootloop or a bricked state, hence a device backup might not be possible. Hence let’s modify this flash file and instruct it not to wipe off the data from your device. This way you will be able to flash the stock ROM on your Pixel 5 device, without losing any data!
- To do so, download an advanced Text Editor such as Notepad++.
- Then head over to the extracted Fastboot ROM and there you should see the flash-all.bat file.
- Right-click on it and select Edit with Notepad++.
- When the file opens, you should see the fastboot -w keyword. The -w in this command wipes off all the data, so just delete that alphabet and the hyphen, save the file and that’s it. Your data won’t be wiped now!
- So if the line was:
fastboot -w update image-redfin-rd1a.200810.020.zip
- It will be changed to:
fastboot update image-redfin-rd1a.200810.020.zip
- Once you have made this change and saved the file, move all the contents of the extracted Fastboot ROM to the platform-tools folder. That is, move the bootloader.img file, three flash files, a radio.img file and the compressed folder inside platform-tools.
- Now boot your Pixel device to Fastboot Mode. For that, power it off. Then press and hold the Volume Down + Power buttons until you see the screen along the similar lines as shown in the below image.
- Once booted to Fastboot, connect it to PC via USB cable.
- Then head over to the platform-tools folder where you have placed the Fastboot ROM files. Type in CMD in the folder’s address bar and hit Enter. This will launch the Command Prompt window.
- Windows users should execute the below command to begin the flashing process:
- This flash file will come into action and would flash the required files on its own. Your device might reboot a couple of times in between the process, this is completely normal.
- Once done, your device should reboot to the OS. If it doesn’t, then use the hardware key combinations or the below command:
That’s it. These were the steps to restore Pixel 5 to Stock Firmware and unbrick it via Flash-All Script. This was the automated method and should do its job most of the time. And if it worked out for you, then you may skip the below STEP 3B and move over to STEP 4. However, if you are facing any issue or two, then you could manually flash these files via Fastboot Commands. Here are the required commands for the same.
STEP 5B: Restore Pixel 5 to Stock Firmware via Fastboot Commands
- To begin with, make sure that all the ROM files (including the ZIP file) are placed inside the platform-tools folder.
- Then type in CMD in the folder’s address bar and hit Enter. This will launch the Command Prompt window.
- Now execute the below commands in the CMD window to manually flash the individual stock firmware files. Copy-paste the first command, hit Enter, copy-paste the second one, and so on. After flashing each image file, we will be rebooting your device to bootloader (via fastboot reboot-bootloader command). This is an important step and shouldn’t be skipped. The last command (fastboot reboot) will boot your device to the OS:
fastboot flash bootloader <bootloader image file name>.img fastboot reboot-bootloader fastboot flash radio <radio image file name>.img fastboot reboot-bootloader fastboot update <image zip file name>.zip fastboot reboot
That’s it. With this, you have successfully restored Pixel 5 to Stock Firmware via Fastboot Commands and unbricked it. Let’s now move onto the final step.
STEP 6: Relock Bootloader Pixel 5
The fourth and final step requires you to relock the bootloader on your Pixel 5 device. Here are the steps for the same:
- Connect your device to the PC via USB cable and boot it to Fastboot Mode.
- For that, you could use the hardware key combinations or execute the below command in the CMD window (make sure to enable USB Debugging)
adb reboot bootloader
- Once booted to Fastboot Mode, type in the following command to relock the device’s bootloader
fastboot flashing lock
- You may now get a prompt on your device. Use the Volume keys to select Yes and hit the Power key to confirm the selection.
- Your device should now reboot to the OS. If it doesn’t, then use the power key to do so or execute the below command:
With this, we conclude the guide on how to restore your Pixel 5 device to stock firmware via Fastboot and unbrick it. If you still have any queries concerning the aforementioned steps, do let us know in the comments section below. We will get back to you with a solution at the earliest.
- How to Fix Soft brick/Bootloop after installing TWRP Recovery
- Fix fastboot: error: Couldn’t parse partition size ‘0x’
- How to Fix Android Device stuck in Fastboot Mode
- How to fix FAILED (status read failed (Too many links))