How to Unroot the Google Pixel & Pixel XL
Need to unroot your Pixel or Pixel XL? Maybe you’ve taken rooting too far and now need a clean slate? Maybe you need to sell the phone? Either way, it’s pretty easy to get it all back to stock.
Thanks to Google providing us with the firmware on their own site (since it is a Google built device), it comes down to just flashing that and relocking the bootloader using some commands in ADB.
If you’re ready, here’s how to unroot the Pixel or Pixel XL.
Before You Begin
- You should’ve rooted your device using our how to root the Google Pixel & Pixel XL procedure.
- This procedure has been written keeping Windows as the host OS.
- This will get your device back to the stock firmware so please backup everything that you wish to keep.
- This will also re-lock the bootloader on your device.
- You should have set up ADB on your PC before you can do this procedure.
Unrooting the Google Pixel & Pixel XL
To unroot the device, you’ll flash the stock system image on the phone and then re-lock the bootloader using the standard bootloader re-locking method. Here’s how to do that.
Downloading Required Files
- Download the Factory Image for your device and save it to your desktop.
Factory Image for Pixel & Pixel XL (Download the one that is for your device)
Unrooting the Google Pixel & Pixel XL
- Extract files from Factory Image over to the ADB folder located in the C:/ drive of your PC.
- Head to Menu > Settings > About phone on your device and tap on Build number for 7 times to unlock the developer menu.
- Head to Menu > Settings > Developer options and turn on USB debugging.
- Plug in your device to your PC using a USB cable.
- Open the ADB folder on your PC and hold down Shift on your keyboard and right-click anywhere on your screen and select Open command window here.
- Type in the following command into the command prompt window and hit Enter (your device will reboot into bootloader mode after that):
adb reboot bootloader
- Next up, type in the following command into the command prompt window and press Enter:
flash-all.bat
- It will launch the file that will flash all of the factory image files on your device. Wait for it to finish flashing all the files.
Your device will reboot when the firmware has been fully flashed.
You may now wish to re-lock the bootloader on your device. Here’s how to do that:
Re-locking the Bootloader on the Google Pixel & Pixel XL
- Turn off your device.
- Hold down Volume DOWN and Power buttons together for a few seconds.
- Your device will reboot into the bootloader mode.
- Plug in your device to your PC using a USB cable.
- Open the ADB folder on your PC and hold down Shift on your keyboard and right-click anywhere on the screen and select Open command window here.
- Type in the following command into the command prompt window and press Enter:
fastboot oem lock
- Follow the on-screen instructions to re-lock the bootloader on your device.
The bootloader on your Google Pixel or Pixel XL should now be re-locked.
Done! Let me know in the comments below how it went for you or if you need help!
im getting an error when running fash-all.bat saying there not enough space for image-marlin zip file. Do you have a fix?
Means you need to clear some storage on the phone.
Hey I am having the same problem, I am running the rom resurrection remix and i have deleted as much storage and memory as possible and still getting the same error, I am new to the pixel xl and in need of your help please!
It simply means what it says. You might want to check your file explorer on the device and look for larger files like backups that might not show up normally in the system settings but are taking up space and delete them.
Thanks, I was able to return it to stock by using the unified toolkit.
So glad to hear that worked!
hey david, I have a question for you. I could really use your help. sorry for the trouble
Go for it, Tyler.
I too get this same error, however, I have 100 gb of free space, and ive tried again after erasing all the phone data and trying from fresh. Any ideas?
You have 100 gbs where? On an SD card or the internal storage?
internal, I have the 128 GB Pixel XL
Check this for more info – https://forum.xda-developers.com/pixel-xl/help/flash-3-factory-images-clue-t3494838
I have the same issue with Pixel. Can’t get this to work. More, when I check internal memory with file explorer, all folders have gibberish names as well as their contents. There’s nothing of the standard folders like Download, Music, DCIM, etc. How am I supposed to flash back original stock when I keep on getting this no memory message?
I received this phone already rooted. I’ll try to give you as much info as I possibly can to see if it helps
Android Version: 7.1.1
Android Security Patch: March 5 2017
Baseband Version 8996-012511-1611190200
Kernel Version: 3.18.31-PureKernel-Pixel-1.0.3
nate@buildMachine-Z170S #1
Fri Mar 17 20:43blahblahblah
PureNexus Version: 7.1.1-20170317-OFFICIAL
Vendor Version: NOF26V
Build Number: NOF27C
https://uploads.disquscdn.com/images/62de46f4fc9025711bc1f7aded104a5e235cba2e964d1ac206901a9351afe6f5.jpg
When I do it, at the end it says
archive does not contain boot.sig
archive does not contail recovery.img
please help i can not unroot
Not sure what model you have, but sometimes it doesn’t contain those things and it just continues. Otherwise if it won’t continue, you need to redownload the firmware as it could have been corrupted.
Yeah i unrooted it, thanks alot
OK, glad to hear!
How did you fix it? I’m getting the same error
Sarim how were you able to unroot it?
When I do “flash-all.bat” it says permission denied.
I’m doing this on a mac. Can someone help?
Hi David. I tried these steps to root and unroot my pixel. rooting was successful but while unrooting, i got stuck in the bootloader mode. Please suggest. I used the pixel 2 factory image while unrooting. Now it wont boot in normal mode