Nexus 5 Android 6.0.1刷机、Root
Nexus 5 Android 6.0.1刷机、Root
2016-01-24
一、 准备
1. 备份通讯录等数据,切记。
2. 准备adb 、fastboot。网上搜索可以下载到,如果已安装Android开发环境,可直接使用android-sdk\platform-tools目录下的adb.exe(依赖AdbWinApi.dll、AdbWinUsbApi.dll)和fastboot.exe。解压到D:\adb目录,并将D:\adb目录添加到环境变量。
3. 下载Nexus 5 官方Android 6.0.1刷机包: hammerhead-mmb29s-factory-6bfcdfa4.tgz (链接: https://dl.google.com/dl/android/aosp/hammerhead-mmb29s-factory-6bfcdfa4.tgz)
附:
Google官方下载页:https://developers.google.com/android/nexus/images
驱动下载页:https://developers.google.com/android/nexus/drivers
4. 下载TWRP for LG Nexus 5:
twrp-2.8.7.1-hammerhead.img : https://twrp.me/devices/lgnexus5.html
5. 下载SuperSU v2.64 :
https://download.chainfire.eu/750/SuperSU/BETA-SuperSU-v2.64-20151220185127.zip?retrieve_file=1
二、 刷机
1. 谷歌官方刷机说明( https://developers.google.com/android/nexus/images ):
Factory Images for Nexus Devices
This page contains binary image files that allow you to restore your Nexus device's original factory firmware. You will find these files useful if you have used the Android Open-Source Project, flashed custom builds on your device, and wish to return that device to its factory state.
These files are for use only on your personal Nexus devices and may not be disassembled, decompiled, reverse engineered, modified or redistributed by you or used in any way except as specifically set forth in the license terms that came with your device.
Flashing Instructions
To flash a device using one of the system images below (or one of your own), you need the latest fastboot tool. You can get it from one of the sources below.
From a compiled version of the Android Open Source Project.
From the platform-tools/ directory in the Android SDK. Be sure that you have the latest version of the Android SDK Platform-tools from the SDK Manager.
Once you have the fastboot tool, add it to your PATH environment variable (the flash-all script below must be able to find it). Also be certain that you've set up USB access for your device, as described in the Using Hardware Devices guide.
Caution: Flashing a new system image deletes all user data. Be certain to first backup any personal data such as photos.
To flash a system image:
Download the appropriate system image for your device below, then unzip it to a safe directory.
Connect your device to your computer over USB.
Start the device in fastboot mode with one of the following methods:
Using the adb tool: With the device powered on, execute:
adb reboot bootloader
Using a key combo: Turn the device off, then turn it on and immediately hold down the relevant key combination for your device. For example, to put a Nexus 5 ("hammerhead") into fastboot mode, press and hold Volume Up + Volume Down + Power as the device begins booting up.
If necessary, unlock the device's bootloader by running:
fastboot oem unlock
The target device will show you a confirmation screen. (This erases all data on the target device.)
Open a terminal and navigate to the unzipped system image directory.
Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system.
Once the script finishes, your device reboots. You should now lock the bootloader for security:
Start the device in fastboot mode again, as described above.
Execute:
fastboot oem lock
Locking bootloader will wipe the data on some devices. After locking the bootloader, if you want to flash the device again, you must run fastboot oem unlock again, which will wipe the data.
2. 即:
第一步,进入快速启动模式:adb reboot bootloader
第二步,解锁:fastboot oem unlock
第三步,解压刷机包hammerhead-mmb29s-factory-6bfcdfa4.tgz,其中的image-hammerhead-mmb29s.zip不需要解压,执行:flash-all
D:\adb \hammerhead-mmb29s>flash-all
sending 'bootloader' (3120 KB)...
OKAY [ 0.330s]
writing 'bootloader'...
OKAY [ 0.530s]
finished. total time: 0.860s
rebooting into bootloader...
OKAY [ 0.094s]
finished. total time: 0.094s
target reported max download size of 1073741824 bytes
sending 'radio' (45425 KB)...
OKAY [ 1.829s]
writing 'radio'...
OKAY [ 3.126s]
finished. total time: 4.955s
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.000s
< waiting for device >
target reported max download size of 1073741824 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
Creating filesystem with parameters:
Size: 13725835264
Block size: 4096
Blocks per group: 32768
Inodes per group: 8144
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 3351034
Block groups: 103
Reserved block group size: 823
Created filesystem with 11/838832 inodes and 93654/3351034 blocks
Cannot read image.
Creating filesystem with parameters:
Size: 734003200
Block size: 4096
Blocks per group: 32768
Inodes per group: 7472
Inode size: 256
Journal blocks: 2800
Label:
Blocks: 179200
Block groups: 6
Reserved block group size: 47
Created filesystem with 11/44832 inodes and 5813/179200 blocks
--------------------------------------------
Bootloader Version...: HHZ12k
Baseband Version.....: M8974A-2.0.50.2.28
Serial Number........: ____________________
--------------------------------------------
checking product...
OKAY [ 0.100s]
checking version-bootloader...
OKAY [ 0.100s]
checking version-baseband...
OKAY [ 0.100s]
sending 'boot' (9154 KB)...
OKAY [ 1.030s]
writing 'boot'...
OKAY [ 0.784s]
sending 'recovery' (10012 KB)...
OKAY [ 1.185s]
writing 'recovery'...
OKAY [ 0.825s]
erasing 'system'...
OKAY [ 1.318s]
sending 'system' (1020413 KB)...
OKAY [ 50.106s]
writing 'system'...
OKAY [ 87.608s]
erasing 'userdata'...
OKAY [ 20.853s]
erasing 'cache'...
OKAY [ 0.610s]
sending 'cache' (13348 KB)...
OKAY [ 0.709s]
writing 'cache'...
OKAY [ 1.068s]
rebooting...
finished. total time: 166.896s
Press any key to exit...
出现archive does not contain 'system.sig'之后,需要等待一段时间,然后会继续。最后刷机成功。
三、 Root
1. 先安装twrp
a. 搞定adb和fastboot的驱动
b. 解锁您的nexus设备的bootloader
c. 找到适配您的nexus设备的twrp(如果下面列表没有找到的话,您可以在https://twrp.me/Devices/ 输入相关设备名即可找到最新的)
d. 关机,将nexus设备进入bootloader状态具体办法是在关机状态下,同时按住电源键和音量下。然后进入以下界面后,就表示设备已经进入了bootloader模式。
e. 刷入twrp的img(使用fastboot flash recovery twrp.img)。这里可能需要一点dos命令,在命令提示符输入相关命令进入您的电脑桌面(这里将twrp-2.8.7.1-hammerhead.img文件名改成了twrp.img),然后输入相关的命令。
f. 刷入成功后,可以在bootloader状态下,用音量键来选择"recovery mode"来进入twrp。
2. 通过第三方recovery twrp刷入supersu.zip包
前提:
a. 解锁了您的nexus6p/5x/5/6/7/9
b. 搞定fastboot驱动
c. 刷入了安卓6.0或者安卓6.0.1原生系统
d. 刷入了twrp等第三方的recovery
具体的步骤(以nexus 5为列):如果您之前使用过刷入修改版内核办法,请重新刷回原生的内核,再行操作。注意:(开始我还以为楼主的supersu有问题,原来是我安装完成以后,直接点的完成,其实supersu并没有完全安装。刷入完成之后,原来必须退回到twrp主界面下,点选reboot,再选择system直接重启。这样才算完全安装了。)
a. 通过USB将nexus 5和电脑相连接。
b. 上面提供的地址找到supersu 2.64 beta版,然后保存到手机的download目录(不需要解压)。
c. 将设备进入bootloader模式,然后用音量键来选择recovery模式,进入twrp(如果没有刷入twrp请先刷入),然后通过twrp的install来刷入supersu 2.62 beta的zip包来实现安卓6.0/6.0.1的root。重启前如果twrp提示你没有root刷入supersu的话,一定要选择否,不然会坏事。
四、 Android 6.0使用中遇到的问题
问题:Android 6.0 已连上网络 但无法访问互联网
在安卓6.0里引入了一个wifi监测功能,这个模块会和谷歌服务器进行通讯以检查wifi网络是否真的有互联网连接,由于在中国大陆谷歌服务器无法访问,所以手机无法连接就会提示“已连接,但无法访问互联网”,所以这是正常的情况,请周知了,另外,wifi和信号还带有感叹号,这个是在安卓5.x时代就引入的网络监测模块,同样也是由于谷歌服务被墙导致的,具体解决办法见:http://www.inexus.co/article-2990-1.html
第3种方法比较麻烦,适用于未ROOT用户:
1、关机-开机-连上wifi
2、设置-用户-添加新用户
3、此时会出现和刚刷机完以后那样需要网络连接,一直点下一步,让手机连接网络
4、关键,当进行到正在联网时,强制关机
5、开机
6、切换下网络,你会发现感叹号很快消失了
7、删除刚刚新添加的用户
五、 参考:
1. 品尝棉花糖之Nexus5线刷Android6.0攻略:
http://blog.csdn.net/lincyang/article/details/47836835
2. [1228更新]nexus 5x/6p/5/6/7/9 安卓6.0.1一键root办法 :
http://www.inexus.co/thread-23604-1-1.html
3. nexus 4/5/5x/6/6p/7/9/10刷第三方recovery twrp教程:
http://www.inexus.co/thread-23627-1-1.html
4. android 6.0 已连上网络 但无法访问互联网:
[更新]关于WiFi和信号图标出现感叹号消除办法 : http://www.inexus.co/article-2990-1.html