This guide shows how to restore Google Pixel XL to stock and unbrick it by flashing Google’s factory images with fastboot. The Pixel and Pixel XL were manufactured by HTC, but Google designed them and sells them as Google phones, so the official factory images come straight from Google.

Warning: Follow every step carefully and in order, and do it at your own risk. Unlocking the bootloader and flashing the factory images wipes the phone’s data unless you change the flash script as explained below. If anything is unclear, ask before you start.

restore-google-pixel-xl-to-stock

Why Restore Your Pixel XL to Stock

If you have been experimenting with your Pixel XL, you are probably familiar with resetting the phone, booting into the bootloader and recovery mode, and flashing factory images. Sooner or later you may run into problems such as overheating, random reboots, hanging and lag, Wi-Fi and network issues, a bootloop or a soft brick. Knowing how to reset the Pixel XL and restore it to stock lets you fix these problems yourself.

Prerequisites to Restore Google Pixel XL to Stock

Take care of these preparations before you flash the factory images:

Steps to Flash Factory Images on Google Pixel XL

Once the preparations above are done, you can start flashing.

Step 1: Copy the factory image to the ADB folder

Copy the downloaded factory image ZIP package (in this example marlin-nde63l-factory-71a65e7e.zip) to the Minimal ADB and Fastboot installation folder you noted earlier.

pixel-xl-factory-image

Step 2: Extract the package

Extract the contents of the ZIP file into the same folder. The fastboot folder should then look like this:

pixel-xl-factory-images

Step 3: Boot into bootloader mode

Turn off the phone and boot it into bootloader mode: press and hold Volume Down + Power until you see the screen shown below.

bootloader-mode-google-pixel

Step 4: Connect the phone

Connect the Pixel XL to your computer with the stock USB cable and wait a few seconds so the device drivers can install.

Step 5: Open Minimal ADB and Fastboot

Launch Minimal ADB and Fastboot from the desktop shortcut. If you did not create the shortcut, open Windows Start menu > All Programs > Minimal ADB and Fastboot. A command window opens.

Step 6: Check the connection

Run the following command to make sure the phone is connected. The command window shows a code (serial number) for your device.

fastboot devices

The original guide uses adb devices here, but adb does not list a phone that is in bootloader mode. Use fastboot devices while the phone is on the bootloader screen.

Step 7: Run the flash script

Type the following command in the command window and press Enter:

flash-all.bat

minimal-adb-fastboot-flash-all-bat

Step 8: Wait for the flash to finish

The installation starts and the command window shows the output of each process, similar to this:

C:\Program Files (x86)\Minimal ADB and Fastboot>flash-all.bat
target reported max download size of 536870912 bytes
sending 'bootloader_a' (32820 KB)...
writing 'bootloader_a'...
(bootloader) Valid bootloader version.
rebooting into bootloader...
< waiting for any device >
target reported max download size of 536870912 bytes
sending 'radio_a' (57048 KB)...
writing 'radio_a'...
rebooting into bootloader...
< waiting for any device >
target reported max download size of 536870912 bytes
archive does not contain 'recovery.img'
archive does not contain 'vendor_other.img'
wiping userdata...
Creating filesystem with parameters:
Size: 26663190528
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 6509568
Block groups: 199
Reserved block group size: 1024
Created filesystem with 11/1630208 inodes and 146354/6509568 blocks
--------------------------------------------
Bootloader Version...: 8996-012001-1608281716
Baseband Version.....: 8996-012511-1609150631
Serial Number........: xxxxxxxxxxxxxx
--------------------------------------------
checking product...
checking version-bootloader...
checking version-baseband...
sending 'boot_a' (26481 KB)...
writing 'boot_a'...
erasing 'system_a'...
sending sparse 'system_a' 1/3 (523506 KB)...
writing 'system_a' 1/3...
sending sparse 'system_a' 2/3 (524279 KB)...
writing 'system_a' 2/3...
sending sparse 'system_a' 3/3 (512303 KB)...
writing 'system_a' 3/3...
erasing 'system_b'...
sending sparse 'system_b' 1/4 (517263 KB)...
writing 'system_b' 1/4...
sending sparse 'system_b' 2/4 (514150 KB)...
writing 'system_b' 2/4...
sending sparse 'system_b' 3/4 (516790 KB)...
writing 'system_b' 3/4...
sending sparse 'system_b' 4/4 (96127 KB)...
writing 'system_b' 4/4...
erasing 'vendor_a'...
sending 'vendor_a' (234277 KB)...
writing 'vendor_a'...
Setting current slot to 'a'...
erasing 'userdata'...
sending 'userdata' (138957 KB)...
writing 'userdata'...
rebooting...

finished. total time: 128.109s
Press any key to exit...

Step 9: Reboot the phone

When you are asked to press a key, do so. The phone reboots automatically.

After the Flash

The first boot after restoring the phone to stock can take about 5-8 minutes, so wait patiently until the welcome screen appears. Complete the initial setup and the phone is ready to use. Your Google Pixel XL is now restored to stock with the factory images.

More Google Pixel Guides (droidviews.com)

Related Guides

FAQ

Will flashing the factory images erase my data?

Yes, by default. The flash-all.bat script wipes user data, and unlocking the bootloader also wipes the phone. Removing -w from flash-all.bat keeps your data during the flash, but back up first either way.

Can I use factory images for a different Pixel model?

No. Download only the factory image for the Pixel XL, codename marlin. Images for another model can leave the phone unable to boot.

The command window does not show my phone. What should I do?

Make sure the phone is in bootloader mode, use fastboot devices rather than adb devices, reinstall the Google USB driver and try another USB cable or port.

How long does the first boot take?

About 5-8 minutes. Do not interrupt it.

Source: this guide was originally published on droidviews.com (http://www.droidviews.com/restore-google-pixel-xl-to-stock-flash-factory-images/).

https://droid-developers.com/wp-content/uploads/2016/11/restore-google-pixel-xl-to-stock.jpghttps://droid-developers.com/wp-content/uploads/2016/11/restore-google-pixel-xl-to-stock-150x150.jpgFahim MahmudHow ToSoftware FixFlash Factory Images,Restore Google PixelThis guide shows how to restore Google Pixel XL to stock and unbrick it by flashing Google's factory images with fastboot. The Pixel and Pixel XL were manufactured by HTC, but Google designed them and sells them as Google phones, so the official factory images come straight from Google. Warning:...Android Help,Troubleshooting  & Stock Rom