[Nexus 5X General] Mr hOaX:
Heya Nexus 5X Users,

In this thread, I'll help you to flash factory images on your nexus 5x. This process will wipe your device, so please BACKUP YOUR DATA before going through the flashing process.​

You can backup your data from some well-known apps from Play Store

- Titanium Backup (Root)

- Super Backup (Non-root)

- Helium (Non-root) etc

​

Step 1 : Pre-requisite

==> Setup your workspace by following step two from this (Credits [MENTION=4153349]Heisenberg[/MENTION])

==> For MAC users, you can follow this thread (Credits [MENTION=4086419]AshtonTS[/MENTION])

==> For Linux users, you can follow this thread (Credits [MENTION=2605063]bloodychaos[/MENTION])

Step 2 : Downloading Factory Images

==> You can find Nexus 5X(bullhead) factory images from here.

Step 3 : Extracting Factory Images

==> Extract the archive you downloaded (First extract bullhead-XXXXX.tgz and then extract bullhead-XXXXX.tar). You can use WinRaR or 7z etc. It should look like this

[IMG="Contents after extracting"]https://i.imgur.com/DHETXv8.png[/IMG]

Step 4 : Unlock the bootloader

==> Follow this thread. (Credits [MENTION=4153349]Heisenberg[/MENTION])

Step 5 : Flashing

==> Method 1 : (Short and Sweet)

- Power off your phone.

- Boot it in fastboot(bootloader mode) by pressing and holding Power Button + Volume Down at the same time.

- Connect your phone to your PC through your USB cable.

- Execute the flash-all.bat script (for Windows) or flash-all.sh(for MAC and LINUX) in the folder where you extracted the factory images.

**!!** For MAC: You'll have to edit the flash-all.sh, and add "./" before every fastboot command.

(For windows users)

[IMG="fast-all.bat"]http://imgur.com/ymqDJgs.png[/IMG]

- Wait for everything to flash.

- After everything finished, select "Recovery" using the volume buttons.

- When a small dead Android appears, press Power Button + Volume UP.

- Select "Wipe data/factory data reset"

- Reboot. Your phone should be stock.

==> Method 2 : (Long, but works always)

- Extract the image-bullhead-XXXXXX.zip somewhere easy to access (On C:/image-bullhead-XXXXXX for example).

- In the same folder, from the original archive, extract "bootloader-bullhead-XXXXXX.img" (rename it to bootloader.img) and "radio-bullhead-XXXXXX.img" (rename it to radio.img). You will have the following files:

[IMG="method 2"]http://i.imgur.com/XeIIhjb.png[/IMG]

- Power off your phone.

- Boot it in fastboot(bootloader mode) by pressing and holding Power Button + Volume Down at the same time.

- Connect your phone to your PC through your USB cable.

- Open a CMD window.(By pressing shift key + right mouse click at same time)

- Type the following commands, in this order (If you have a different folder, change the path)

fastboot flash bootloader C:/image-bullhead-XXXXXX/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-bullhead-XXXXXX/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-bullhead-XXXXXX/system.img
fastboot flash vendor C:/image-bullhead-XXXXXX/vendor.img
fastboot flash userdata C:/image-bullhead-XXXXXX/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)

fastboot flash boot C:/image-bullhead-XXXXXX/boot.img
fastboot flash recovery C:/image-bullhead-XXXXXX/recovery.img
fastboot erase cache
fastboot flash cache C:/image-bullhead-XXXXXX/cache.img

- After everything finished, select "Recovery" using the volume buttons.

- When a small Android appears, press Power Button + Volume UP.

- Select "Wipe data/factory data reset"

- Reboot. Your phone should be stock.

Please consider downloading a free/paid version of my ANDROID APP

If you want me to include anything in OP or in second post, please quote me on this thread with needed information.

Hit thanks if you appreciate my efforts and if this thread helped you at any moment :) :D

(Credits [MENTION=4346614]abaaaabbbb63[/MENTION] for inspiring me :p )

(Credits [MENTION=4995415]Chirag_Galani[/MENTION] for testing it :p )