• Skip to primary navigation
  • Skip to main content

The Custom Droid

Android Tutorials, Tips, and Development

  • General
  • How-To
  • Downloads
  • ROMs
  • Reviews
  • About
  • Contact
Home ❯ ROMs

Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Nov 3, 2017•by Dhananjay Bhardwaj

Restore Stock Firmware on Google Pixel 2 and Pixel 2 XL

Using this simple and extensive guide, you will be able to easily restore Google Pixel 2 and Pixel 2 XL to stock firmware by flashing the latest factory image using fastboot.

Tweaking a new phone like the all-new Pixel 2 and 2XL will be fun for sure. You may choose to unlock the bootloader, install TWRP recovery, and even custom ROMs. But if in any case, you would want to return back to the stock firmware, what do you do? Well, it’s easy with Google’s in-house devices. All you have to do is flash the factory image provided using fastboot. Just in case that doesn’t sound much easy, we will cover it for you. In this guide, we will be instructing how you can restore Google Pixel 2 to stock firmware using the same method.

Restore Google Pixel 2 and Pixel 2 XL to stock firmware

  • How to Change Active Edge Squeeze Sensitivity on Google Pixel 2 and XL
  • Install Android 8.1 Oreo Developer Preview on Pixel and Nexus
  • Install Google Product Sans Font on Any Android
  • Google Camera NX Brings Pixel 2 Camera Features on Nexus 6P/5X
Table of Contents
  • Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware
    • Prerequisites
    • Step 1: Download Pixel 2/Pixel 2 XL Factory Image
    • Step 2: Extract Factory Image and Connect Your Pixel 2 Device
    • Step 3: [Optional] If you want to preserve Internal Storage Data
    • Step 4: Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware
    • Step 5: Lock The Bootloader

Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Flashing and restoring Google Pixel 2 and Pixel 2 XL to stock firmware is pretty easy, thanks to Google. But it could still be confusing for those who are new to Android or these specific devices itself.

Google is kind enough to provide every major and monthly security updates in the form of factory images. This makes it easier for the device owners to restore their phone back to the stock firmware, just in case if they have unlocked the bootloader, rooted, or tried a custom ROM. Restoring and flashing factory image also allows you to fix any software issues, like boot loops, battery hogging, third-party app issues, etc. So if you’re here for any of the reasons, we will try to help to the best of our knowledge.

In this guide, we will be using the generic method of running the flash-all script to flash the factory image and restore Google Pixel 2 and 2 XL to factory firmware. Additionally, we will be adding an extra step, that will allow you to preserve the data on your internal storage.

Below, we will be detailing how you can restore stock firmware on Google Pixel 2 and Pixel 2 XL. We will begin by fulfilling a few requirements and pre-setup before we get to the actual process.

Prerequisites

  • Enable USB debugging on your Pixel 2 by going to Settings -> System -> Developer options and set up ADB and Fastboot on your PC.
  • Flashing factory image requires you to unlock bootloader on Google Pixel 2 (and 2 XL).
  • The process to restore Google Pixel 2 and Pixel 2 XL will wipe your device completely. So, make sure to backup your complete storage, messages, contacts, and other necessary data pre-hand. You can follow our detailed tutorial to backup Android devices.
  • Charge your Pixel device to at least 60-70% battery level to avoid any sudden shutdowns during the process.

Step 1: Download Pixel 2/Pixel 2 XL Factory Image

First off, download the factory image for your device from the links below. Make sure that you download the files only for your model and carrier. Cross-flashing will result in an unbootable device.

Google Pixel 2 (walleye)

  • 8.0.0: Unlocked | Telstra | Fido, Rogers | Verizon

Google Pixel 2 XL (taimen)

  • 8.0.0: Unlocked | Telstra | Fido, Rogers | Verizon

Once you have downloaded the factory image for your device, you can proceed ahead to restore Google Pixel 2 and Pixel 2 XL to stock firmware.

Step 2: Extract Factory Image and Connect Your Pixel 2 Device

  1. Extract the downloaded factory image file (e.g. walleye-opd1.170816.010-factory-63083164.zip).
  2. Copy the extracted files to the C:\adb folder where all the ADB and fastboot binaries are present.
    Restore Google Pixel 2 to stock firmware - Factory Image Files
    Restore Google Pixel 2 to stock firmware – Factory Image Files
  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.
  4. Now, connect your device to the PC using the USB cable.

Step 3: [Optional] If you want to preserve Internal Storage Data

This is an optional step. It will help you save all your data on the internal storage during the process to restore Google Pixel 2 and 2 XL, which otherwise is wiped off.

  1. Download a quality text editor like Notepad++ and install it on your PC.
  2. Go to the C:\adb folder where all the factory image, ADB and Fastboot files are residing.
  3. Right-click on the flash-all.bat file and select ‘Edit with Notepad++’.
  4. The Notepad++ editor window will open the batch script file.
  5. Find the following line for the Pixel 2 (walleye):
    fastboot -w update-image-walleye-xxx.xxxxxx.xxx.zip
  6. For the Pixel 2 XL (taimen):
    fastboot -w update-image-walleye-xxx.xxxxxx.xxx.zip
  7. Here “xxx.xxxxxx.xxx” is the build version number.
    Restore stock firmware on Google Pixel 2 - Editing 'flash-all.bat'
  8. Now, edit this line and remove “-w” from it.
  9. This is the fastboot flag responsible for erasing the userdata and cache partitions. Since you are going to remove it from the flashing script, it will no more execute the command and erase the partitions. Thus, you will have the data on your internal storage intact.
  10. Once done, click on the save icon on the top.

Step 4: Restore Google Pixel 2 and Pixel 2 XL to Stock Firmware

Now, it is very easy to flash the factory image. Go to the C:\adb folder and double-click on the “flash-all.bat” script. The Command Prompt window will open up and detect your device. In a few minutes, all the flashing process must be complete.

Step 5: Lock The Bootloader

Now, if you also wish to relock your device’s bootloader, then execute the following command too. Lock the bootloader using:

fastboot flashing lock

The device shall prompt you with a confirmation message. Just use the Volume buttons to highlight ‘Yes’ using the Power button and press the Power button to lock the bootloader.

Nexus 6P Lock bootloader warning

You have just been able to restore Google Pixel 2 and the Pixel 2 XL to stock firmware. If you have any problems while performing the restoration process, then feel free to ask us.

Tagged under: Factory Reset, Restore Stock Firmware

Reader Interactions

Comments

  1. Jamie

    Jul 15, 2020

    Hi, I don’t see the “flash all.bat” file. I downloaded a “minimal adb and fastboot” package that was recommended on another article. I’ve attempted the flash but the phone just sits in the ‘verifying’ mode.

    Do I still need to do something special to save my data? That is the only reason I’m doing this OTA flash, rather than a factory reset (I’ve never done anything like this before so I definitely want to be as clear as i can be about it because a lot of it doesn’t make sense, haha).

    Any help is much appreciated, thank you.

    Reply
    • Dhananjay

      Jul 15, 2020

      Hi Jamie. Please avoid using Minimal ADB/Fastboot or any other sort of one-click ADB installations. The majority of them include old versions of ADB and Fastboot tools.

      I always recommend setting up the Android SDK platform-tools (ADB & Fastboot) manually. It doesn’t take more than a few minutes to do it. Before you proceed any further, I would request you to follow the instructions on this page and set up the Platform-tools on your Windows, macOS, or Linux machine.

      Once you have done that, let me know so that I can help you further install the factory image. Also, would you please share why exactly are you doing this?

  2. avicena

    May 29, 2020

    how to unlock bootloader pixel 2 verizon version?

    Reply
    • Dhananjay

      May 31, 2020

      Hello. A method was found to allow bootloader unlocking on the Verizon Pixel 2 (not the Pixel 2 XL though). The method was then patched by Google in an update.

      It might be possible that you could downgrade the phone to the old software version, then unlock the bootloader, and finally update to the latest software again.

      All the information you will need could be found on this XDA thread. Feel free to let me know if you have any more questions.

  3. Vivek Singh

    Dec 7, 2018

    Hello,

    I need help can you help me out , i did what you told in page but its not happening correctly some error is showing.

    So can you help me out please

    Reply
    • Dhananjay

      Dec 7, 2018

      Hi Vivek. Please let me know the exact error you are getting, possibly a screenshot which will help me fully understand the problem.

  4. abhinav gaur

    May 13, 2018

    cant detect my device on batch file

    Reply
    • Dhananjay

      May 13, 2018

      You need to make sure that ADB/Fastboot are properly installed and setup on your PC. Kindly follow the two guides in the given order:

      1) How to Install ADB on Windows, Linux, and macOS
      2) Use ADB and Fastboot from Any Directory on Windows and Linux

Leave a Reply Cancel reply

Comment Policy: We welcome relevant and respectable comments. Only input your real first name and valid email address if you want your comment to appear. Read our comment policy fully before posting a comment.

Recent Posts

How to open ADB/Fastboot command window inside Platform-Tools on Windows, macOS, and Linux

Open ADB/Fastboot Command Window in Platform-Tools

Download Magisk v22 w/ New Magisk App, Galaxy S21 support, and more

[Download] Magisk v22.1 – New Magisk App, Galaxy S21 Support, Bug Fixes, and more

How to Install TWRP on Snapdragon Galaxy S20 and root using Magisk

Install TWRP on Snapdragon Galaxy S20/S20+/S20 Ultra and Root using Magisk

©2017 - 2021 TheCustomDroid.com Privacy Terms Disclaimer Request Tutorial