[TUTORIAL][GUIDE][HOW TO] Flash Factory Images || Unroot || Relock bootloader

Are you Happy buying Nexus 6 ?

  • Yes ofcourse

    Votes: 1,374 87.3%
  • Not really

    Votes: 122 7.8%
  • May be in future

    Votes: 78 5.0%

  • Total voters
    1,574
Search This thread

chmodbot

Member
Feb 13, 2011
46
5
I have a question that I searched did not see in here. If I go through this process leave the phone back to stock and unlocked is there a point via the google OTA that the phone will be un-rootable again? Also One small question is there easy way to add back in the tethering capabilities ?
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,383
Deep Space Station K7
I have a question that I searched did not see in here. If I go through this process leave the phone back to stock and unlocked is there a point via the google OTA that the phone will be un-rootable again? Also One small question is there easy way to add back in the tethering capabilities ?
You are asking about a Nexus 6 right?

There will not be any more OTAs pushed for this device. The phone reached end of official support last October (2017).

EDIT: so never say never. I guess google pushed an OTA today (just saw a bunch of Reddit posts). Installing this OTA either will not work on a rooted phone, or more likely lose root due to the boot.img (systemless root) being overwritten. While FlashFire is also EOL, it still works and should be able to install the OTA, and "keep" root, *IF* The root method you are using is systemless supersu. Or just flash [Magisk] as part of the update process. Caveat, to use FF, either you need to already have installed the pro version, or set the device date manual back to prior to April 1, 2018 - the date the time bomb in the FF app went off. For more info, see the FF thread here on XDA.

Also, the nexus line will never be un-rootable. I supposed if developers keep producing the newest android ROMs, P is being worked on for this device, that there is some possibility that the boot.img becomes impossible to root. In an unlikely case like that, this device would not be the only one affected. And putting that ROM on, would be a choice, not something that would just happen because of an OTA.

I'm not aware of any problem with tethering. I'm not on stock but when I was it worked fine.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 
Last edited:
Sep 21, 2017
15
0
I want to flash the new bootloader apq8084-72.04, but I am afraid of wiping out the internal memory data, do not know whether there is wiped out the internal memory?
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,383
Deep Space Station K7
I want to flash the new bootloader apq8084-72.04, but I am afraid of wiping out the internal memory data, do not know whether there is wiped out the internal memory?
As long as you don't use a -w during a complete package flash or flash the userdata partition, internal should be safe.

To flash only the bootloaders, you should use the method 2 approach in the OP;

fastboot flash bootloader C:/image-shamu-XXXXXX/bootloader.img

It is always a good idea to back up your data in case of problems.

"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
 
  • Like
Reactions: barnettejd

jc1266

Senior Member
Feb 19, 2017
166
12
Sir. ..pls advice me I am using stock rom rooted with magisk . So I am sell off my fone .. I would llike revert to original . What should I do ??
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,383
Deep Space Station K7
Sir. ..pls advice me I am using stock rom rooted with magisk . So I am sell off my fone .. I would llike revert to original . What should I do ??

A factory reset should be enough, unless you have TWRP installed. Then you need to flash a factory image.

Which ever way you go, make sure to remove your Google account (and any others) on your phone. Go to Settings > Users & accounts > and then select your Google account. Tap on Remove account. Do this for any other accounts there. Then do a factory reset or if necessary, a factory image flash.

If you do not do the above step, factory reset protection (FRP) will kick in and the new user can not use the device without your Google credentials.
 

jc1266

Senior Member
Feb 19, 2017
166
12
Thanks u sir ..I do have twrp installed . Can I just flash only stock recovery img. Then remove account then do a factory reset . Then locked the bootloader. Is it okay if I do the??
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,383
Deep Space Station K7
I'm sure you could flash only stock recovery from the factory image. It's not what I would do if I'm selling my phone and don't want to be bothered after the buyer receives it.

I would just fastboot flash the entire image (using the -w flag to wipe user data), set the phone up using my account, make sure everything works correctly, then remove my account and factory reset.
 
  • Like
Reactions: barnettejd

underblade239

Member
Apr 28, 2012
10
3
Santo Domingo
ITS ALIVE

Heya Nexus 6 Users,

In this thread, I'll help you to flash factory images on your nexus 6. 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 @xBeerdroiDx)

==> For MAC users, you can follow this thread (Credits @AshtonTS)

==> For Linux users, you can follow this thread (Credits @bloodychaos)


Step 2 : Downloading Factory Images

==> You can find Nexus 6(shamu) factory images from here.


Step 3 : Extracting Factory Images

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

XTNNqMd.png



Step 4 : Unlock the bootloader

==> Follow this thread. (Credits @xBeerdroiDx)


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)

h355rHW.png


- 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-shamu-XXXXXX.zip somewhere easy to access (On C:/image-shamu-XXXXXX for example).
- In the same folder, from the original archive, extract "bootloader-shamu-moto-XXXXXX.img" (rename it to bootloader.img) and "radio-shamu-XXXXXX.img" (rename it to radio.img). You will have the following files:

vWX7X5f.png


- 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)

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

fastboot flash boot C:/image-shamu-XXXXXX/boot.img
fastboot flash recovery C:/image-shamu-XXXXXX/recovery.img
fastboot erase cache
fastboot flash cache C:/image-shamu-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.

(Credits @abaaaabbbb63)

(Credits @Chirag_Galani for testing it :p )

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

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



Video Guides

Thanks Anuj Patel

For Windows:


For MAC:



Damn it ... finally thanks to the method 2, it has come back, it finally worked for everyone that has this same case followed the instructions of the method 2 as such.

In my case when flashing the stock image was flashing all right but present me this: (bootloader) has-slot: bootloader: not found ..... at the end the phone loaded the whole system well but when I tried to restart it either to enter recovery or some application I asked for a reboot, it stayed in the google image and nothing else, I tried everything and in the end the method 2 worked perfectly, I did not let me do the last step of restarting in recovery and doing a wipe data or fatory reset but in the end everything is fine
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,383
Deep Space Station K7
How do I determine which version of sharmu to download? Thanks!
Unless you have a specific reason not to, you should use the latest release.

7.1.1 (N6F27M, Oct 2017)

7.1.1 (N8I11F, Oct 2017, T-Mobile)

7.1.1 (NGI77B, Oct 2017, Verizon)

Be aware, if you are freshly downloading fastboot and ADB to your PC, you may find the current releases no longer support our old shamu. Look here on XDA for one of the older standalone releases that date back to 2015/16.


"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
 
  • Like
Reactions: dtien

MicroMod777

Recognized Contributor
Unless you have a specific reason not to, you should use the latest release.

7.1.1 (N6F27M, Oct 2017)

7.1.1 (N8I11F, Oct 2017, T-Mobile)

7.1.1 (NGI77B, Oct 2017, Verizon)

Be aware, if you are freshly downloading fastboot and ADB to your PC, you may find the current releases no longer support our old shamu. Look here on XDA for one of the older standalone releases that date back to 2015/16.


"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Is it possible to flash Verizon firmware on a T-Mobile branded N6 if I'm oem unlocked?
 

MicroMod777

Recognized Contributor
Unless you have a specific reason not to, you should use the latest release.

7.1.1 (N6F27M, Oct 2017)

7.1.1 (N8I11F, Oct 2017, T-Mobile)

7.1.1 (NGI77B, Oct 2017, Verizon)

Be aware, if you are freshly downloading fastboot and ADB to your PC, you may find the current releases no longer support our old shamu. Look here on XDA for one of the older standalone releases that date back to 2015/16.


"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Thanks. tried the Verizon version on my ATT branded and I had to flash it manually after several tries. On boot though, it still shows the ATT logo. Thought it would have transformed it into a Verzion version.
 
Last edited:

k.pax

Member
Aug 7, 2009
36
0
Hi
can you help me for flash stock rom witout pc ??
usb port on my device not recognized by pc , i have custom recovery and 7.1.2 slim rom ... is there stock rom by custome recovery capability ???
 

cavh17

Member
Mar 5, 2021
11
1
At a loss here. I've followed the guide at the beginning (method 2) and everything went fine. Phone is working. However, when I try to relock the boot loader it says to load signed images first. I'm using the 7.1.1 T-Mobile image from the Google download page. Tried the generic one as well, same issue. Any ideas?

Thx!
 

pas7771

Senior Member
Jun 18, 2011
126
9
SOLVED

Hello,
What are my options for this situation on a Nexus 6:
'Allow OEM Unlock' in Developer Options is OFF there is no more os in my phone.

C:\SDK\android-sdk-windows\platform-tools>fastboot oem unlock
...
(bootloader) Check 'Allow OEM Unlock' in Developer Options.
FAILED (remote failure)
finished. total time: 0.003s

C:\SDK\android-sdk-windows\platform-tools>

Anyway to unlock bootloader?
Thanks
 
Last edited:

pas7771

Senior Member
Jun 18, 2011
126
9
I got my problem resolved by going in stock recovery mode and using the adb sideload option I installed the final OTA update (N8I11F)
it upgraded fine.
Then I could enable the OEM unlock option in developer mode. to unlock the bootloader.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 198
    Heya Nexus 6 Users,

    In this thread, I'll help you to flash factory images on your nexus 6. 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


    I am not responsible if anything goes wrong.


    Step 1 : Pre-requisite

    ==> Setup your workspace by following step two from this (Credits @xBeerdroiDx)

    ==> For MAC users, you can follow this thread (Credits @AshtonTS)

    ==> For Linux users, you can follow this thread (Credits @bloodychaos)


    Step 2 : Downloading Factory Images

    ==> You can find Nexus 6(shamu) factory images from here.


    Step 3 : Extracting Factory Images

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

    XTNNqMd.png



    Step 4 : Unlock the bootloader

    ==> Follow this thread. (Credits @xBeerdroiDx)


    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)

    h355rHW.png


    - 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-shamu-XXXXXX.zip somewhere easy to access (On C:/image-shamu-XXXXXX for example).
    - In the same folder, from the original archive, extract "bootloader-shamu-moto-XXXXXX.img" (rename it to bootloader.img) and "radio-shamu-XXXXXX.img" (rename it to radio.img). You will have the following files:

    vWX7X5f.png


    - 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)

    Code:
    fastboot flash bootloader C:/image-shamu-XXXXXX/bootloader.img
    fastboot reboot-bootloader
    fastboot flash radio C:/image-shamu-XXXXXX/radio.img
    fastboot reboot-bootloader
    fastboot flash system C:/image-shamu-XXXXXX/system.img
    fastboot flash userdata C:/image-shamu-XXXXXX/userdata.img 
    (Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
    
    fastboot flash boot C:/image-shamu-XXXXXX/boot.img
    fastboot flash recovery C:/image-shamu-XXXXXX/recovery.img
    fastboot erase cache
    fastboot flash cache C:/image-shamu-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.

    (Credits @abaaaabbbb63)

    (Credits @Chirag_Galani for testing it :p )

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

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



    Video Guides

    Thanks Anuj Patel

    For Windows:


    For MAC:

    22
    >> Quick FAQs <<

    Q1. Do I need to root the device before flashing?
    Ans. NO

    Q2. Will I loose device root status after flashing?
    Ans. YES

    Q3. Do I need to unlock bootloader before flashing?
    Ans. YES

    Q4. Can I skip any of the above steps in any method?
    Ans. NO

    Q5. Do I need to tick USB Debugging in Developer options before flashing?
    Ans. NO (Answer corrected by @samersh72)

    Q6. My device is not detected in my PC. What should I do?
    Ans. Reinstall the drivers properly.

    Q7. Can I root my device after flashing process?
    Ans. YES

    Q8. Which method is recommended for me?
    Ans. Method 2 if you are not expert in flashing.

    Q9. What will be my device status after flashing?
    Ans. Stock Android with bootloader unlocked

    Q10. My device is taking time to boot up. What should I do now?
    Ans. Wait for 10-15 mins before thinking of reflashing.

    Q11. My phone has 3GB RAM, can I flash factory images directly without using PC?
    Ans. NO

    Q12. How many times can I flash my device?
    Ans. More than 0

    Q13. Will I loose my data after flashing?
    Ans. YES

    Q14. I have some other query...
    Ans. Please post it in Q&A section.

    Q15. I am noob in all this. I am flashing for the very first time. Can you provide me support online via any software?
    Ans. Follow each step as mentioned in first post. You'll be 100% successful.

    Q16. What will be status of bootloader after flashing?
    Ans. Unlocked

    Q17. What is fastboot mode?
    Ans. Bootloader mode.

    Q18. Can I take screenshot of my bootloader mode using power+volume down?
    Ans. NO

    Q19. Any other easy way to flash?
    Ans. If there was, I would have mentioned it.

    Q20. Do you recommend me using toolkits to do this job?
    Ans. NO

    Q21. Can I connect my device over the air and flash it from PC?
    Ans. NO

    Q22. I don't have my device USB right now. Can I flash using other compatible USB cable?
    Ans. YES

    Q23. I have installed the drivers properly, still it's not recognized by my PC?
    Ans. Use other USB port

    Q24. How do I relock bootloader after flashing? (For 5.0.X)
    Ans. Follow this. (Credits @BRKotucs)

    Q25. I am having problems with unzipping the file. Can you help me?
    Ans. Read this (Credits @av8rdude)

    Q26. I am unable to get into stock recovery, what should I do?
    Ans. Read this (Credits @jj14 and @WMguy)

    Q27. It shows 32GB storage for 64GB storage device after flashing, where is my 32GB lost ?
    Ans. Read this (Credits @efrant)

    Q28. I need some information on adb and fastboot, what are those commands ?
    Ans. Read this (Credits @rootSU)


    Q29. Will I get OTA updates from Google after successfully completing any of the above methods ?
    Ans. YES (Do not root or alter any system files)

    Q30. I want to relock the bootloader after flashing? (For 5.1.X)
    Ans. Follow this. (Credits @Evolution_Freak)

    Q31. Can I flash back to Android version 5.0.1 if I'm on Android version 5.1?
    Ans. NO
    14
    So, after following instructions fully, not skipping any step from method 2, my 64Gb shows up as a 32Gb. Any ideas?
    Reboot into the bootloader and type this:

    fastboot format userdata
    fastboot format cache
    fastboot reboot

    That will obviously wipe all your data again, but it should return back to 64GB
    9
    //Reserved

    If you want me to include anything in OP or in second post, please quote me on this thread with needed information.
    6
    HOW DO I LOCK THE BOOTLOADER?

    Before you get started you need to make sure Android boots properly then go to.... Settings / Developer Options / to "ENABLE" OEM Unlocking



    Lock The Bootloader
    • Turn the phone off. Then boot it into the bootloader/fastboot mode by holding volume down + power.

    • Plug the phone into your PC, then open a command prompt window and type:
      Code:
      cd Desktop/android-sdk-windows/platform-tools
      Code:
      fastboot devices
      This command will list the connected devices. If your phones serial number shows up you are good to go and may continue. If the phone is NOT listed this indicates that your drivers are not installed correctly. In order for you to continue you must fix your drivers so that your phone is listed under fastboot devices.

    • If the phone has been recognized by the command above, proceed to locking the bootloader with the following command:
      Code:
      fastboot oem lock

    • After the above command has finished executing, run the following command.
      Code:
      fastboot reboot

      Done.
    • Close the command prompt window.

    Sent from my Nexus 6 using Tapatalk