nexus 手动增加
Google’s Nexus devices are supposed to receive timely updates, but the staggered rollout means it can take weeks for devices to receive over-the-air (OTA) updates. Luckily, there’s a faster (and geekier) way to install the latest version of Android.
Google的Nexus设备应该会及时收到更新,但分阶段推出意味着设备可能需要数周的时间才能收到空中(OTA)更新。 幸运的是,有一种更快(更怪异)的方法来安装最新版本的Android。
Google provides official system images for their Nexus devices, which anyone can download and flash on their own. This is an easy way to skip the wait when a new version of Android is released for Nexus devices.
Google为Nexus设备提供了官方的系统映像,任何人都可以自行下载并刷新。 当为Nexus设备发布新版本的Android时,这是跳过等待的简单方法。
Note that this process is more complicated than simply waiting for an over-the-air update. If you’re a normal person and not a geek with an itchy trigger finger, you’ll probably just want to wait.
请注意,此过程比仅等待无线更新更为复杂。 如果您是普通人,而不是触发手指发痒的怪胎,您可能只想等待。
第一步:解锁设备的引导程序 (Step One: Unlock Your Device’s Bootloader)
To flash a system image, your device will need to be unlocked. Nexus devices allow you to unlock their bootloader with a single command. If you’ve already unlocked your device to root it or install a custom ROM, you can skip this part. If you haven’t yet, you should be warned the unlocking your device will wipe its data, as if you had performed a factory reset.
要刷新系统映像,您的设备将需要解锁。 Nexus设备可让您通过一个命令解锁其引导程序。 如果您已经解锁了设备以使其成为root用户或安装了自定义ROM,则可以跳过此部分。 如果尚未开始,则应警告您,解锁设备将擦除其数据,就像您已恢复出厂设置一样。
You can unlock your boot loader in several different ways. The official method is through a simple teriminal command, but for an even easier method, you can use the Nexus Root Toolkit, which will walk you through the process.
您可以通过几种不同的方式解锁引导加载程序。 官方方法是通过一个简单的终止命令,但对于更简单的方法,您可以使用Nexus Root Toolkit ,它将逐步引导您完成该过程。
第二步:安装ADB和Fastboot (Step Two: Install ADB and Fastboot)
You’ll need two other things for this process: the Android Debug Bridge, which is a command line tool for your computer that lets you interface with your phone, and your phone’s USB drivers. Even if you’ve installed these before, you should get the latest versions now.
此过程还需要另外两件事:Android调试桥,这是计算机的命令行工具,可让您与手机连接;以及手机的USB驱动程序。 即使您以前已经安装了这些,也应该立即获取最新版本。
We’ve detailed how to install both before, but here’s the brief version:
在此之前,我们已经详细介绍了如何安装这两种方法,但是这是简短的版本:
Head to the Android SDK download page and scroll down to “SDK Tools Only”. Download the ZIP file for your platform and unzip it wherever you want to store the ADB files.
转到Android SDK下载页面,然后向下滚动到“仅SDK工具”。 下载适合您平台的ZIP文件,然后将其解压缩到要存储ADB文件的位置。
- Start the SDK Manager and deselect everything except “Android SDK Platform-tools”. If you are using a Nexus phone, you can also select “Google USB Driver” to download Google’s drivers. 启动SDK Manager,然后取消选择除“ Android SDK Platform-tools”以外的所有内容。 如果您使用的是Nexus手机,则还可以选择“ Google USB驱动程序”来下载Google的驱动程序。
- After it’s finished installing, you can close the SDK manager. 安装完成后,您可以关闭SDK管理器。
Install the USB drivers for your phone. You can find these on your phone manufacturer’s website (e.g. Motorola or HTC). If you have a Nexus, you can install the Google drivers you downloaded in step 2 using these instructions.
安装手机的USB驱动程序。 您可以在电话制造商的网站(例如Motorola或HTC )上找到它们。 如果您有Nexus,则可以按照以下说明安装在步骤2中下载的Google驱动程序。
- Reboot your computer if prompted. 如果出现提示,请重新启动计算机。
第三步:下载系统映像 (Step Three: Download the System Image)
Visit Google’s Factory Images for Nexus Devices page and download the appropriate image for your device. Note that you’ll need the image for your specific hardware. For example, there are separate images for the Nexus 7 (2013) with Wi-Fi only and for the Nexus 7 (2013) with cellular data. Make sure you download the right one.
访问Google的Nexus设备出厂图像页面,并下载适合您设备的图像。 请注意,您将需要特定硬件的映像。 例如,对于仅具有Wi-Fi的Nexus 7(2013)和具有蜂窝数据的Nexus 7(2013),存在单独的图像。 确保下载正确的一个。
Download the file to your computer and use a file-extraction program, like the free 7-Zip, to extract its contents to your ADB folder.
将文件下载到计算机,并使用文件提取程序(例如免费的7-Zip )将其内容提取到您的ADB文件夹中。
第四步:确定是否擦除数据 (Step Four: Decide Whether to Wipe Your Data)
Flashing the system image in the normal way will wipe your device, essentially performing a factory reset. You can try to update without wiping your device, although you may encounter problems. However, this process should work fine when going from one Android version to the next version.
以正常方式刷新系统映像将擦除您的设备,实质上是恢复出厂设置。 尽管您可能会遇到问题,但是您可以尝试在不擦除设备的情况下进行更新。 但是,当从一个Android版本转到下一版本时,此过程应该可以正常工作。
To prevent your device from being wiped, open the flash-all.bat file in a text editor like Notepad++. Edit the line containing “fastboot -w update” and remove the -w switch before saving the file.
为防止设备被擦拭,请在文本编辑器(如Notepad ++)中打开flash-all.bat文件。 在保存文件之前,编辑包含“ fastboot -w update”的行,并删除-w开关。
第五步:刷新系统映像 (Step Five: Flash the System Image)
Copy the system image files into the same folder as ADB. Then hold the Shift key, right-click in that folder, and select “Open command window here” to open a Command Prompt window in that folder.
将系统映像文件复制到与ADB相同的文件夹中。 然后按住Shift键,右键单击该文件夹,然后选择“在此处打开命令窗口”以在该文件夹中打开命令提示符窗口。
Enable USB debugging on your Nexus device by accessing the hidden Developer Options menu and turning on the USB debugging option.
通过访问隐藏的“开发人员选项”菜单并打开USB调试选项,在Nexus设备上启用USB调试。
Connect your Nexus device to your computer with its included USB cable, and then run the following command to reboot the device into the boot loader:
使用随附的USB电缆将Nexus设备连接到计算机,然后运行以下命令将设备重新引导到引导加载程序中:
adb reboot bootloader
If there’s a problem, you may need to fix your device’s drivers. Read this guide for more information on setting up ADB and ensuring it’s working properly. Bear in mind that you’ll have to accept the authentication prompt on the device before the adb command can do anything.
如果有问题,则可能需要修复设备的驱动程序。 阅读本指南以获取有关设置ADB并确保其正常运行的更多信息。 请记住,在adb命令可以执行任何操作之前,您必须接受设备上的身份验证提示。
Once the device displays the boot loader on its screen–you’ll see an Android with its front panel open–double-click the flash-all.bat file. The script should flash your device with the new system image.
设备在屏幕上显示引导加载程序后,您会看到一个前面板打开的Android设备,双击flash-all.bat文件。 该脚本应使用新的系统映像刷新设备。
When the process is complete, your device will reboot automatically. If you didn’t remove the -w option, you’ll have to go through the first-time setup process again.
该过程完成后,您的设备将自动重启。 如果未删除-w选项,则必须再次执行首次设置过程。
如果脚本不起作用怎么办 (What to Do If the Script Doesn’t Work)
Sometimes, however, flash-all.bat will generate an error about missing resources or lack of space. In that situation, it’s generally better to just manually flash everything piece by piece. This trick is also useful if you only want to flash part of the factory image–like the bootloader or the recovery–without flashing the rest.
但是,有时flash-all.bat会生成有关资源丢失或空间不足的错误。 在这种情况下,通常最好逐个手动刷新所有内容。 如果您只想刷新部分工厂映像(如引导加载程序或恢复映像)而又不刷新其余部分,则此技巧也很有用。
The first thing you’ll need to do before inputting the manual commands is unzip the image file, which typically uses the “image-device-build.zip” naming format. It’s easier to unzip the contents of the file directly into the folder you’re already working in so all the required files are in the same location. Once unzipped, there should be five or six additional files in your working folder (depending on the device): android-info.txt, boot.img, cache.img, recovery.img, system.img, radio.img (for devices with mobile connections only), and vendor.img (Nexus 9 only).
输入手动命令之前,您需要做的第一件事是解压缩图像文件,该文件通常使用“ image -device-build .zip”命名格式。 将文件内容直接解压缩到您已经在使用的文件夹中比较容易,因此所有必需的文件都位于同一位置。 解压缩后,工作文件夹中应有五个或六个其他文件(取决于设备):android-info.txt,boot.img,cache.img,recovery.img,system.img,radio.img(针对设备) (仅限移动设备)和vendor.img(仅限Nexus 9)。
Once everything is unpacked, reboot back into the bootloader–using the adb reboot bootloader
command from earlier–and run the following commands, pressing Enter after each one, to manually flash each item to your device.
解压缩所有内容后,使用较早版本的adb reboot bootloader
命令重新引导回adb reboot bootloader
,然后运行以下命令,每输入一个命令后按Enter键,以手动将每个项目刷新到设备中。
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot flash bootloader "name-of-bootloader.img"
fastboot reboot-bootloader
fastboot flash radio "name-of-radio.img" (if present)
fastboot reboot-bootloader
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img
fastboot flash vendor vendor.img (Nexus 9 only)
If you’re doing a clean install of Android and want to wipe everything, use the following commands next:
如果您要全新安装Android并想擦除所有内容,请在下面使用以下命令:
fastboot erase userdata
fastboot flash userdata userdata.img
fastboot reboot
Keep in mind that some of these commands can take time some to flash—namely system.img and userdata.img—so don’t worry if the command prompt seems to be unresponsive. Once it’s ready for the next command, the cursor will re-appear.
请记住,其中一些命令可能需要一些时间才能刷新(即system.img和userdata.img),因此请不要担心命令提示符似乎没有响应。 一旦准备好执行下一个命令,光标就会重新出现。
This process is also useful if you’ve flashed a custom ROM and need to get back to the standard Android system image that comes with your device. This option is largely intended for developers and Android geeks, so it’s more complicated than simply waiting for a normal OTA (over-the-air) update.
如果您已经刷新了自定义ROM并且需要返回到设备随附的标准Android系统映像,则此过程也很有用。 此选项主要用于开发人员和Android极客,因此它比简单地等待正常的OTA(空中下载)更新要复杂得多。
翻译自: https://www.howtogeek.com/176284/how-to-upgrade-your-nexus-device-without-waiting-by-flashing-a-factory-image/
nexus 手动增加