We now are offering Devs Base Swag. Get yours now. https://teespring.com/devs-base-swag
http://www.zazzle.com/devs_base

[GUIDE] [Nexus] How to Unlock/Root/Flash Nexus Devices

User avatar
Paschfire
Posts: 42
Joined: Sat Oct 29, 2016 12:06 am
Location: Ottawa, ON. Canada
Been thanked: 17 times

Re: RE: [GUIDE] [Nexus] How to Unlock/Root/Flash Nexus Devices

Postby Paschfire Thu Nov 17, 2016 6:50 pm

SonarMonkey wrote:This tutorial should be applicable to the Nexus 5, Nexus 6, Nexus 5X, and Nexus 6P. If anyone notices a potential error, please let me know. These processes may not be applicable to the Pixel or Pixel XL, and should not be considered applicable to any Non-Google/Non-Nexus device.

I only own a Nexus 5X, and am using a Mac, so the exact names of various options may not be 100% correct. Feel free to notify me of the correct names so I can update this guide.

I am NOT RESPONSIBLE for anything that happens to your, your device, your computer, or your surrounding environment if you attempt any of the processes detailed herein. You have been warned.

If you are not comfortable with using whatever command line is present on your computer, I would recommend familiarizing yourself with said command line before attempting any of the processes in this guide. Whenever I state "Do x thing by running: y code", I mean that you need to type that code into your command line.


What You'll Need:

A fully up-to-date ADB/Fastboot environment installed via the Android SDK. I won't detail how to install the SDK here, as the process will vary slightly depending on whether you have a OSX, Linux, or Windows computer, but the applicable instructions can be found here.

You can check whether ADB is working by running this in your command line:

Code: Select all

adb version


Additionally, once you plug your device into your computer, you can check whether your computer has recognized the device(make sure to enable USB Debugging in your Developer Options) by running the command:

Code: Select all

adb devices



How to Unlock the Bootloader:

    1. Enable Developer Options on your device. Do this by going to "About Phone" in Setting, and tapping "Build Number" 5 times.

    2. Go to Developer Options and enable "USB Debugging" and "OEM Unlocking".

    3. Plug your device into your computer, and click OK when asked if you would like to allow USB debugging.

    4. Check if ADB is working by running:

    Code: Select all

    adb devices

    You should receive your device's Serial Number

    5. Reboot into your bootloader by running:

    Code: Select all

    adb reboot bootloader

    You may have to wait a few seconds.

    6. Unlock your bootloader by running either the first command(if you have a Nexus 5 or 6) or the second command(if you have a Nexus 5X or 6P):

    Code: Select all

    fastboot oem unlock

    Code: Select all

    fastboot flashing unlock

    This will erase all of your data! Do not unlock your bootloader if you are not okay with this!
    You should be prompted on your device to confirm that you would like to unlock your bootloader, you simply need to scroll to the "Yes" option using your volume keys, and select the option with your power key.

    7. Wait for the process to complete.

    8. Reboot your device by running:

    Code: Select all

    fastboot reboot

Never re-lock your bootloader if you are not on 100% stock android, otherwise you may irrecoverably brick your phone. I will detail how to return to stock later in this guide.


How to Flash a Custom Recovery:

You will need a custom recovery to root, flash custom ROMs or Kernels, install mods, etc. You must already have unlocked your bootloader to install a custom recovery. Do not attempt to install a custom recovery with a locked bootloader.

    1. Download the appropriate version of TWRP for your device here.

    2. Navigate to where TWRP is located on you computer via the command prompt by running:

    Code: Select all

    cd /path/to/TWRP

    On Windows, you must have TWRP in the same folder as fastboot.exe, and you simply have to start a command prompt from within that folder via right clicking in your file manager, and selecting "Open Command Prompt Here".

    3. Reboot into your bootloader by running:

    Code: Select all

    adb reboot bootloader


    4. Flash the recovery to your device by running:

    Code: Select all

    fastboot flash recovery <filename>.img

    You may have to wait a few seconds.

    5. On your device, select the "Reboot Bootloader" option. Once the bootloader restarts, select "Reboot to Recovery".

    6. Wait for TWRP to start. You may be asked if you would like to flash SuperSU. Do not say yes. You may also be asked if you would like to leave your /system partition intact. You will need to "Swipe to Allow Modifications" if you would like to do any flashing.


    How to Root:

    1. Download the latest version of SuperSU to your phone, found here. Other root solutions are available, but SuperSU is the current primary method of acquiring root access. If you would like to use a different root solution, follow the included instructions wherever you found said solution. I may update this guide with Magisk instructions, but until then, I'm only going to recommend SuperSU.

    2. Boot into TWRP by running:

    Code: Select all

    adb rebooot recovery


    3. Go to "Install", and navigate to wherever you placed the downloaded .zip file.

    4. Swipe to install, and wait for the process to finish.

    5. You'll be presented with two options: "Wipe Cache & Dalvik" and "Reboot". First, select "Wipe Cache & Dalvik", and swipe to wipe. Then, go back one menu, and reboot your device. It may restart a few times, but this is normal. Wait for your phone to start back up and you should have root access.


How to Flash a Custom ROM:

Remember to always make a Nandroid backup in TWRP before flashing, so you have something to go back to in case something goes wrong. You can create a Nandroid backup in TWRP by simply selecting "Backup", swiping to start the backup, and waiting for it to complete.

    1. Download a ROM and GApps package to your device. Make sure the ROM is designed for your device, and never install a ROM meant for a different device.

    2. Reboot into TWRP.

    3. Do a full wipe: select "Wipe", go to "Advanced Wipe", select System, Data, Cache, and Dalvik Cache, and swipe to wipe.

    4. Install the ROM and GApps one after another using the "Install" option. If the ROM or GApps has an AROMA installer, you may have to select various options that you'd like to install. Simply follow the instructions on the screen, and wait for the process to finish.

    5. Reboot your device, and wait for it to start up.

First I just want to say your Guide above is simply excellent. Being an owner of a Nexus 5 I must say, I would have been over joyed to have stumbled onto this tutorial for the first time rooting my Device way back when.
It's detailed, easy to follow and has everything thing you need available just a quick link click away.

I do have one small suggestion though, only because I have fallen susceptible to a few issues that have arisen during SuperSU versions SR2~3 on my N5, one being the lack of logs being displayed/recorded within the SuperSU app(DU11-N-7.0), another being interactive shell when requested by some root apps seems very slow to answer the call (Eg. FKU), there's also apparently a small chance of force encryption being enabled though I haven't had an issues related with encryption.

SuperSU-2.78SR4 has resolved all issues I stated above for me and might seem to be a more reliable choice(as of today anyways) for user to download.

I hate bringing suggestions to the table without be able to offer any example of a possible solution in return, though it seems proving to be more difficult than I thought it to be in finding an appropriate Download Link to use for SuperSU, one that would offer the latest version available and not become depreciated after an update other than linking the direct XDA page of SuperSU found here. > http://forum.xda-developers.com/apps/su ... 5-t2868133

I do have the chainfire.eu download page link for SR4 though, if you see fit in update your current Link. > https://download.chainfire.eu/1013/Supe ... 184928.zip

Thanks.


Sent from my Nexus 5 using Devs Base mobile app powered by Tapatalk
User avatar
SonarMonkey
Posts: 10
Joined: Sat Oct 29, 2016 12:42 am
Location: Nowhere
Has thanked: 4 times
Been thanked: 2 times

RE: [GUIDE] [Nexus] How to Unlock/Root/Flash Nexus Devices

Postby SonarMonkey Sun Nov 20, 2016 1:04 am

Paschfire wrote: First I just want to say your Guide above is simply excellent. Being an owner of a Nexus 5 I must say, I would have been over joyed to have stumbled onto this tutorial for the first time rooting my Device way back when.
It's detailed, easy to follow and has everything thing you need available just a quick link click away.

I do have one small suggestion though, only because I have fallen susceptible to a few issues that have arisen during SuperSU versions SR2~3 on my N5, one being the lack of logs being displayed/recorded within the SuperSU app(DU11-N-7.0), another being interactive shell when requested by some root apps seems very slow to answer the call (Eg. FKU), there's also apparently a small chance of force encryption being enabled though I haven't had an issues related with encryption.

SuperSU-2.78SR4 has resolved all issues I stated above for me and might seem to be a more reliable choice(as of today anyways) for user to download.

I hate bringing suggestions to the table without be able to offer any example of a possible solution in return, though it seems proving to be more difficult than I thought it to be in finding an appropriate Download Link to use for SuperSU, one that would offer the latest version available and not become depreciated after an update other than linking the direct XDA page of SuperSU found here. > http://forum.xda-developers.com/apps/su ... 5-t2868133

I do have the chainfire.eu download page link for SR4 though, if you see fit in update your current Link. > https://download.chainfire.eu/1013/Supe ... 184928.zip

Thanks.


Sent from my Nexus 5 using Devs Base mobile app powered by Tapatalk



Thank you so much for the kind words! I really appreciate the suggestion, as well. I was unaware of these issues (I've been using Magisk and phh's SuperUser), and I'm sorry I didn't get back to you sooner. I will certainly go ahead and update the guide with the appropriate links. For now, I guess I'll just have to update the guide with each new update to SuperSU. If you(or anyone else) finds a better solution than that, please reply to this thread or PM me!
I'm not a developer or a team member, but I help where I can!

Current Setup:
► Show Spoiler

Return to “Other How-Tos”

Who is online

Users browsing this forum: No registered users and 1 guest