[펌] [GUIDE] Unlock/Root/Flash for Nexus 6P
http://forum.xda-developers.com/nexus-6p/general/guides-how-to-guides-beginners-t3206928
Nexus 6P

Intro
This thread will serve as a location for basic how-to guides for the Nexus 6P. I'm going to start off with a couple of the more obvious ones and go from there. If anyone has any suggestions for additions please feel free to let me know.
If you're unsure about something please read the FAQ section in post #3 before creating a post to ask a question.
Prerequisites:
Always update your phone to the latest build available before starting the unlocking/rooting process. This guide is always current/correct as per the requirements of the most recent build available.
You'll need a working adb/fastboot environment on your PC to get through some of these guides.
You must have Java installed and up to date in order to use the SDK Manager, please ensure that this is taken care of before installing the SDK.
Please do not install adb/fastboot via any means other than the Android SDK, using other tools (like Minimal adb & fastboot) can lead to an outdated setup and various problems with flashing. You've been warned, other tools will not be supported in this thread.
Go here to download the Android SDK, which will give you most updated version of adb and fastboot. Scroll to the bottom of the page and find Other Download Options>SDK Tools Only, and grab the right version for your OS. While it's downloading create a folder in C:\ called SDK (C:\SDK). Once you've downloaded the zip you can extract it into your C:\SDK folder. Navigate to C:\SDK\android-sdk-windows and open SDK Manager.exe. In SDK Manager you need to install the following packages:
Tools> Android SDK Tools, Android SDK Platform-tools
Extras> Android Support Library, Google USB Driver
Once you have installed those, inside C:\SDK you should see some new folders, one of them will be called platform-tools, within that folder you should see fastboot.exe and adb.exe. I'll refer to this as your fastboot folder/directory or working folder/directory during this guide. To make sure adb is correctly installed, open a command prompt from within your fastboot folder (hold shift + right click, select open command prompt here) and issue this command:
adb version
If it returns a version number for Android Debug Bridge then you're good to go.
You can test adb by connecting your device to your PC while booted into Android (making sure that adb/usb debugging is enabled in Settings>Developer Options) with the screen unlocked and issuing this command:
adb devices
It should return your device serial number, if so, adb is working.
You can test fastboot by connecting your device to your PC while booted into the bootloader (power + volume down) and issuing this command:
fastboot devices
It should return your device serial number, if so, fastboot is working.
By attempting any of the processes listed this thread you accept full responsibility for your actions. I will not be held responsible if your device stops working, catches on fire, or turns into a hipster and claims to have been modified before it was cool.

Quick Tips
How to boot into the bootloader:
Power off your device. Once it's powered off hold power + volume down and the phone will boot into the bootloader. You can also use the following adb command:
adb reboot bootloader
You can also use an app called Quick Boot to boot into the bootloader directly from Android (root required).
How to boot into recovery:
Boot into the bootloader (see above), use the volume keys to scroll through the options and use the power button to select the recovery mode option. You can also use the following adb command:
adb reboot recovery
You can also use an app called Quick Boot to boot into the recovery directly from Android (root required).

Index
Post #1
1. How To Unlock Your Bootloader
2. How To Install A Custom Recovery On Your Device
3. How To Decrypt Your Data Partition
4. How To Make A Nandroid Backup With TWRP Recovery
5. How To Make An EFS Backup With TWRP Recovery
6. How To Root
Post #2
7. How To Install A ROM with TWRP Recovery
8. How To Install A Custom Kernel With TWRP Recovery
9. How To Update To A New Build Of The Stock ROM
10. How To Flash The Factory Images (Return To Stock)
11. How To Flash The Factory Images (Return To Stock But Leaving Internal Storage Intact)
12. How To ADB Sideload an incremental OTA update package.
13. How To ADB Sideload a full OTA update package.
14. How To Update To Android 7.0 Nougat
FAQ can be found in post #3!

1. How To Unlock Your Bootloader
- Go into Settings/About Phone, scroll down and click on “build number” continuously until you see a toast notification telling you that you've enabled Developer Options. Go back to your Settings menu and enter Developer Options, scroll down and click on the “Enable OEM Unlock” checkbox, also make sure you enable USB Debugging while you're in the Developer Options menu.
- Power off your phone then boot into the bootloader (power + volume down).
- Connect your phone to your PC via usb cable.
- Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here).
- Check your fastboot connection by issuing this command:Code:
fastboot devices
It should return your device serial number, if not you need to make sure your drivers are installed correctly.
- Once you've confirmed your fastboot connection issue the unlock command:This will erase all user data from the device!Code:
fastboot flashing unlock
- You should now see a screen on your phone asking you to confirm this action, use the volume keys to scroll and the power key to confirm if you're sure you want to go ahead.
- Allow the process to complete and then issue this command:Code:
fastboot reboot
- Allow everything to go ahead and once finished you can disconnect your usb cable.
Note: After unlocking your bootloader, each time your phone boots up you'll be greeted with a warning that says "Your device software can't be checked for corruption. Please lock the bootloader". This is nothing to worry about, it's normal to see this when you have an unlocked bootloader. You can't remove it, as long as your bootloader is locked it will stay there.
Important: do not relock your bootloader unless your phone is fully stock. You must flash the factory images first in order to remove root and custom recovery (if you have them), if this precaution isn't taken you may end up with a brick. Please see section 10 of this guide for full instructions on how to return to stock.

2. How To Install A Custom Recovery On Your Device
Prerequisites: unlocked bootloader (section 1).
- Download the latest TWRP Recovery. For Nougat it must be TWRP 3.0.2-1 or later.
- Make sure you check the md5 of the file to verify its integrity (where possible).
- Place the file in your fastboot folder (this is where fastboot.exe is located on your PC).
- Boot into the bootloader. Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here), enter this command:(The recovery filename in the command will change depending on which recovery you're flashing)Code:
fastboot flash recovery <filename>.img
- Use the volume keys to scroll and power key to select the Reboot Bootloader option. Once the phone has booted back into the bootloader you can use the volume keys to scroll and the power key to boot into your newly flashed recovery. It's now safe to disconnect your usb cable.
When TWRP boots up you'll be asked whether you want to allow system modifications or to keep it read-only, choose to allow system modifications, there's no benefit to keeping it read-only.
Do not flash the version of SuperSU that TWRP offers to flash for you in order to give you root, it is not compatible and will cause problems. When you attempt to reboot out of TWRP it will tell you that it's detecting that you don't have root and it will offer to root for you, skip past this.

3. How To Decrypt Your Data Partition
This is no longer necessary as long as you use TWRP 2.8.7.1 or newer, unless you are using the Android N developer preview, in which case you must decrypt.
Prerequisites: unlocked bootloader (section 1).
TWRP recovery cannot decrypt your data partition at this stage. In order for TWRP to be able to read/write on your data partition (to root or create a nandroid backup) you will need to format it, a format will remove encryption.
- Boot into the bootloader and connect your phone to your PC via usb cable.
- Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here), enter this command:Please note: this will erase all user data from the device!Code:
fastboot format userdata
- Once the process has completed you can either reboot normally:Or you can reboot back to the bootloader in order to undertake another task:Code:
fastboot reboot
Code:fastboot reboot-bootloader

4. How To Make A Nandroid Backup With TWRP Recovery
Prerequisites: unlocked bootloader (section 1), TWRP recovery (section 2).
Warning: before you make a backup with TWRP you must remove all lockscreen security. If you do not do this you will not be able to unlock your device after restoring your backup (entering your pin will result in an "incorrect pin" message), you'll be forced to perform a factory reset to boot into Android. To remove lockscreen security go to Settings>Security>Screen Lock and set it to swipe/none.
A nandroid backup is a very important thing to have before installing any custom software on your device. It's basically a backup of your stock system that you can fall back on if anything goes wrong or if you just want your stock ROM back. You can also use the backup tool to create a backup of your favourite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.
Boot into TWRP and select the backup option from the TWRP home screen, check the system/data/boot/vendor boxes, and swipe to backup. The process will take a few minutes.
Note: If you happened to forget to remove lockscreen security (PIN/Pattern/Fingerprint) before creating your backup, and you cannot get into your OS after restoring, you can do the following to fix the issue. Boot into TWRP and use the built in file manager to delete /data/sytem/locksettings.db. This should be enough to get you into your OS again. If it isn't you can also try deleting /data/system/locksettings.db-shm and /data/system/locksettings.db-wal. If this still doesn't fix your issue you can delete /data/system/gatekeeper.password.key and /data/system/gatekeeper.pattern.key.

5. How To Make An EFS Backup With TWRP Recovery
An EFS backup is very important to have, if your EFS partition becomes corrupt you will have no IMEI, and therefore will not be able to use the phone as a phone. Making an EFS backup is insurance against this catastrophic event. Without a backup, restoring your EFS can be extremely difficult or impossible. The backup you create can be easily restored using the restore tool in TWRP recovery.
Boot into TWRP and select the backup option from the TWRP home screen, make sure only the EFS box is selected, and swipe to backup. The process will take a few seconds. Keep a copy of the backup on your phone and also keep another copy somewhere safe.

6. How To Root
Prerequisites: unlocked bootloader (section 1), TWRP recovery (section 2).
- Download the latest SuperSU of your choosing to your phone:
SuperSU Stable
SuperSU Beta - Boot into TWRP recovery and enter the install menu.
- Navigate to where you have SuperSU stored on your internal storage and select it.
- Swipe to install.
- Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.
Do not flash the version of SuperSU that TWRP offers to flash for you in order to give you root, it is not compatible and will cause problems. When you attempt to reboot out of TWRP it will tell you that it's detecting that you don't have root and it will offer to root for you, skip past this. You do have root, ignore this every time it comes up.

'Development' 카테고리의 다른 글
[펌] ANDROID LESSON SEVEN: AN INTRODUCTION TO VERTEX BUFFER OBJECTS (VBOS) (0) | 2016.08.30 |
---|---|
[펌] 3D Graphics with OpenGL By Examples (0) | 2016.08.26 |
Fade-out 되는 Logo animation 처리 (0) | 2013.08.05 |
Rasberry Pi 홈페이지 (1) | 2013.08.01 |
[Cocos2D] CCLayer를 extends하는 클래스에서 터치 이벤트 핸들링 하기 (0) | 2011.10.21 |