Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Filed under
Updated on
23 May 2020

A detailed step by step guide on how to restore your Google Pixel 2 and Pixel 2 XL to complete stock firmware. Google has always kept it easy for users and developers to unlock the bootloader of their devices. Along those same lines, the steps to unlock the bootloader of Pixel 2 and Pixel 2 XL are also fairly simple. With developer-friendly devices like the Google Pixel lineup, it is pretty hard not to play around with your device. A working TWRP Recovery for Pixel 2 and Pixel 2 XL is already available and it is only a matter of time before Root and Magisk are made available for the device. The thing with messing around with your device is that you do not always get the desired results!

flash stock firmware Pixel 2 xl Return to stock • Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Once root access is available, the gates to customization open! There are a lot of audio mods, custom ROMs, Magisk Modules available and it is sort of tough to not try them out on your device. The thing with root access is that you make one wrong move and you have a brick in your pocket.

In this guide, we will tell you how to return your Google Pixel 2 and Pixel 2 XL to complete stock firmware in case you have bricked your device or just want to go back to full stock. The process is actually pretty easy: Google has all the necessary Pixel 2 and Pixel 2 XL Factory images available for download and all you have to do is simply flash the firmware via fastboot! Sounds a bit complex, let us explain it to you.

Prerequisites

Download Pixel 2 [XL] Factory Images

Before proceeding with the tutorial, we need to make sure we have the necessary factory image files. Thankfully, you can download all the necessary files straight from Google servers.

Warning: Make sure you download the right file for your device model/carrier. Flashing a wrong file might render the device unbootable.

Android Version 8.0.0 Unlocked Telstra Fido, Rogers Verizon
Google Pixel 2 (walleye) Download Download Download Download
Google Pixel 2 XL (taimen) Download Download Download Download

Steps to Flash Stock Firmware on Pixel 2 and Pixel 2 XL

Follow the below steps carefully.

Step 1: Extracting Factory Image

Extract the downloaded Pixel 2 [XL] factory image zip file. For example, if you have downloaded the file ‘walleye-opd1.170816.010-factory-63083164.zip’ > Unzip it.

Step 2: Placing the files on the right directory

Copy the contents of the extracted zip file to the folder where ADB and Fastboot are installed. Most probably this will be C:adb‘ folder orC:Minimal ADB and Fastboot‘ folder. 

Step 3: Boot your Pixel 2 in Bootloader Mode

  • Power off the device completely.
  • Press and hold the Volume Down + Power button altogether until you see the bootloader screen.

Step 4: Connect your device to PC via USB cable.

Step 5: [Optional] Only if you want to Preserve Internal Storage Data:

Flashing stock firmware will completely wipe your device, your data included. But luckily, we have a workaround to not let that happen.  Follow the instructions in this step, if you want to retain all the data even after flashing stock image on your Pixel 2 [XL].

  1. Download and Install Notepad++ on your PC.
  2. Go to the folder where you have copied the extracted factory image files.
  3. Look for a file named flash-all.bat > Right click on it > select Edit with Notepad++’.
  4. The Notepad++ will open the batch script file in editable text format. In that, we are going to remove a small line to make sure our data is preserved after flashing.
  5. Look for the following line for the Pixel 2 [walleye]:
    fastboot -w update-image-walleye-xxx.xxxxxx.xxx.zip

    For the Pixel 2 XL [taimen]:

    fastboot -w update-image-taimen-xxx.xxxxxx.xxx.zip

    Note: ‘xxx.xxxxxx.xxx’ in the above simply represents the build version number. Restore-Stock-Firmware-on-Google-Pixel-2

  6. In the above line, remove the ‘-w’. This is the fastboot flag responsible for erasing the userdata and cache partitions. Removing this will prevent the script from erasing your data.
  7. After making the changes, do not forget to save your changes!

Step 6: Flashing Stock Firmware on Google Pixel 2 and Pixel 2 XL

Here comes the easy part. All there is left to do now is flashing the stock firmware on your Pixel 2 and Pixel 2 XL and Returning them to stock. To do this, go to the folder where ABD is installed [the folder where you have copied the factory image files] and double click on the flash-all.bat script file. Once you open it, a command window is open and the flashing process will be taken care automatically. Within a couple of minutes, the flashing process will complete.

Step 7: Locking the Pixel 2 and Pixel 2 XL Bootloader

This is again optional: If you wish to lock your bootloader:

  1. Make sure your device is in fastboot mode.
  2. Open command window inside the ADB Folder: Hold down Shift Key > Right Click > Select ‘Open Command window here’.
  3. Simply execute the below command at the command prompt window: fastboot flashing lock
  4. The device will prompt you with a confirmation message. relocking-bootloader-Pixel-2Use the Volume buttons to highlight ‘Yes’ and press the Power button to make the selection and lock the bootloader.
  5. Done!

Congratulations, you have successfully flashed stock firmware on your Pixel 2 and Pixel 2 XL and completely returned it to stock!

3 thoughts on “Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware”

  1. I dont think this method works with android 10 on pixel 2. i am getting error msgs when running flash-all.bat script

    Reply
  2. I dont think this method works anymore. Working on a Verizon model Pixel 2 running Android 10 with Mar. 5th, 2020 security update.

    target reported max download size of 536870912 bytes
    sending ‘bootloader_a’ (38728 KB)…
    OKAY [ 1.624s]
    writing ‘bootloader_a’…
    FAILED (remote: Operation is not allowed in Lock State)
    finished. total time: 1.636s
    rebooting into bootloader…
    OKAY [ 0.003s]
    finished. total time: 0.004s
    target reported max download size of 536870912 bytes
    sending ‘radio_a’ (60428 KB)…
    OKAY [ 2.538s]
    writing ‘radio_a’…
    FAILED (remote: Operation is not allowed in Lock State)
    finished. total time: 2.554s
    rebooting into bootloader…
    OKAY [ 0.003s]
    finished. total time: 0.003s
    target reported max download size of 536870912 bytes
    archive does not contain ‘boot.sig’
    archive does not contain ‘boot_other.img’
    archive does not contain ‘recovery.img’
    archive does not contain ‘system.sig’
    archive does not contain ‘system.sig’
    archive does not contain ‘vendor.sig’
    archive does not contain ‘vendor_other.img’
    wiping userdata…
    Creating filesystem with parameters:
    Size: 57071874048
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 32768
    Label:
    Blocks: 13933563
    Block groups: 426
    Reserved block group size: 1024
    Created filesystem with 11/3489792 inodes and 265112/13933563 blocks
    ——————————————–
    Bootloader Version…: mw8998-002.0081.00
    Baseband Version…..: g8998-00020-1912122233
    Serial Number……..: FA7951A04233
    ——————————————–
    checking product…
    OKAY [ 0.002s]
    checking version-bootloader…
    FAILED

    Device version-bootloader is ‘mw8998-002.0081.00’.
    Update requires ‘mw8998-002.0059.00’.

    finished. total time: 0.041s
    Press any key to exit…

    Reply

Leave a Comment