Google has released the Android 6.0 factory images for Nexus 6P and Nexus 5X. Users can download the system images and save as a backup of their device’s firmware. The factory images can be used to fix your soft-bricked Nexus 6P or Nexus 5X. Read on to know how to install the factory images on your Nexus device.
Nexus 6P’s system images (code named ‘angler’) is available with build number MDA89D & MDB08K, while the Nexus 5X’s system images (code named ‘bullhead’) is available with build number MDA89E, MDA89F & MDA89I. All the builds are based on the Android 6.0.0 Marshmallow.
You can download the appropriate system image for your device from Google [HERE]. Follow the instruction below to know how to flash the system images on your Nexus 6P/Nexus 5X.
Installation Instruction:
1. Ensure that proper USB driver for Nexus device is installed on your computer
2. Also, ensure that ADB and Fastboot tools is installed on your computer. You can use Minimal adb and fastboot for this purpose (Details here).
3. Unzip the factory image you have downloaded and move all the contents to the same folder as the Minimal ADB and Fastboot installed on your computer.
4. Enable “USB Debugging” on your device from Developer options
5. Now, boot your device into fastboot/bootloader mode. To do so, power off the device, press and hold both Volume Down and Power button together few seconds.
6. Now, connect your phone to your computer via a USB cable
7. Go to the Minimal ADB and Fastboot folder and open a command window there (shift key + right click and select open command window here option)
8. If the bootloader is locked, type: fastboot oem unlock
at the command prompt, and press Enter. On your phone, choose “Yes” (use volume key) and confirm it by pressing the Power button.
[Note: This will ERASE your device, so make sure you have backed everything up first]
9. With the bootloader unlocked, you can install the system image. To do that, go to the Minimal ADB and Fastboot folder (where you have saved the unzipped factory image) and double click the ‘flash-all script'
.
[This script installs the necessary bootloader, baseband firmware(s), and operating system]
On Windows: Run the file “flash-all.bat”.
On Mac: Run the file “flash-all.sh” using Terminal.
On Linux: Run the file “flash-all.sh”.
[Wait for the process to complete. The phone will reboot automatically]
Finally, you should lock the bootloader again for security. For that, boot your Nexus into fastboot mode, and then issue the command: fastboot oem lock
. (Source)