Android 升级/刷机攻略(Google原生系统Pixel)

由于Google在五月份的I/O大会上新发布了Android P 9.0系统,公司需要测试APP在9.0上的兼容,因此拿到Pixel升级系统。

因为考虑到刷机开发版后无法再检测到更新,所以就还是尽量升级到Beta版。

(此教程也适用于Android Q)

 

升级到Android Beta版

升级到Android Beta最新版,相比刷机的优势在于,后续系统还能继续检查到更新,自动升级

  • 加入Android Beta的计划:(当然要访问这个地址是有一定难度的)

https://www.google.com/android/beta?hl=zh-cn

  • 查看符合条件的设备类型。

Android 升级/刷机攻略(Google原生系统Pixel)_第1张图片

 

 

  • 登录自己的Google账户,就可以查看是否有符合要求的设备

Android 升级/刷机攻略(Google原生系统Pixel)_第2张图片

 

如果发现自己的设备明明是支持的,但是没出现在这个列表里面,却提示如下:

Android 升级/刷机攻略(Google原生系统Pixel)_第3张图片可以在手机设备上重新登录自己的账户。

 

  • 同意升级到Android Beta的协议,同意后一般24小时内手机检查更新时即可检查到最新Beta版的更新包。
  • 手机上检测到新的更新包时,点击update即可。

我从同意协议到设备能检测到更新大概一小时的时间。

Android 升级/刷机攻略(Google原生系统Pixel)_第4张图片

升级完成,重启。就OK了,升级到Beta后如下:

Android 升级/刷机攻略(Google原生系统Pixel)_第5张图片

 

Android 升级/刷机攻略(Google原生系统Pixel)_第6张图片

 

刷机到Android P 版

 

  • 去官方下载固件包:(注意要针对自己的机型去下载)

https://developer.android.com/preview/download?hl=zh-cn

Android Q的镜像在:https://developer.android.com/preview/download.html

Android 升级/刷机攻略(Google原生系统Pixel)_第7张图片

 

  • 将下载后的ZIP包,解压,然后放置Android sdk目录下的platform-tools文件夹里,E:\Android sdk\platform-tools

Android 升级/刷机攻略(Google原生系统Pixel)_第8张图片

  • 按照刷机说明操作:

https://developers.google.com/android/images?hl=zh-cn#instructions

a、通过USB将设备连接到计算机,adb devices能够看到设备连上即可。

Android 升级/刷机攻略(Google原生系统Pixel)_第9张图片
b、使用以下方法之一以快速启动模式启动设备:

c、使用adb工具:在设备启动的情况下,进入Bootloader模式

adb reboot bootloader

或者使用按键组合:关闭设备,然后将其打开并立即按住 设备的相关 按键组合。
d、解锁设备:

fastboot flashing unlock

对于旧设备,运行:fastboot oem lock

pixel 2上操作:

理论上会成功,但是我这边一直提示“flashing unlock is failed”

后来查了下,原因是开发者选项中“OEM解锁”选项的原因,需要关闭。但是这个选项一直是置灰的,所以无解。希望其他的小伙伴成功了的可以支招。

 

pixel 3上操作:

成功,可以看到明确提示,devices unlocked

接下来是Google的官方教程。

e、进cd 命令,进入到刚才解压缩的platform-tools目录中,执行flash-all。

Mac/linux下面直接将flash-all.sh拖到终端即可,Windows系统下双击flash-all.bat
f、脚本运行后,可以看到终端里有操作的进展

(base) alicedembp:~ alice$ cd /Users/alice/Documents/Tool/AndroidSDK/platform-tools 
(base) alicedembp:platform-tools alice$ /Users/alice/Documents/Tool/AndroidSDK/platform-tools/flash-all.sh 
Sending 'bootloader_a' (8501 KB)                   OKAY [  0.290s]
Writing 'bootloader_a'                             (bootloader) Flashing Pack version b1c1-0.2-5260815
(bootloader) Flashing partition table for Lun = 0
(bootloader) Flashing partition table for Lun = 1
(bootloader) Flashing partition table for Lun = 2
(bootloader) Flashing partition table for Lun = 4
(bootloader) Flashing partition table for Lun = 5
(bootloader) Flashing partition msadp_a
(bootloader) Flashing partition xbl_a
(bootloader) Flashing partition xbl_config_a
(bootloader) Flashing partition aop_a
(bootloader) Flashing partition tz_a
(bootloader) Flashing partition hyp_a
(bootloader) Flashing partition abl_a
(bootloader) Flashing partition keymaster_a
(bootloader) Flashing partition cmnlib_a
(bootloader) Flashing partition cmnlib64_a
(bootloader) Flashing partition devcfg_a
(bootloader) Flashing partition qupfw_a
(bootloader) Flashing partition storsec_a
(bootloader) Flashing partition logfs
OKAY [  0.500s]
Finished. Total time: 1.059s
Rebooting into bootloader                          OKAY [  0.080s]
Finished. Total time: 0.080s
Sending 'radio_a' (71196 KB)                       OKAY [  1.690s]
Writing 'radio_a'                                  (bootloader) Flashing Pack version SSD:g845-00020-190222-B-5330671
(bootloader) Flashing partition modem_a
OKAY [  0.414s]
Finished. Total time: 2.414s
Rebooting into bootloader                          OKAY [  0.080s]
Finished. Total time: 0.080s
--------------------------------------------
Bootloader Version...: b1c1-0.2-5260815
Baseband Version.....: g845-00020-190222-B-5330671
Serial Number........: 8CAY15Q65
--------------------------------------------
extracting android-info.txt (0 MB) to RAM...
Checking 'product'                                 OKAY [  0.057s]
Checking 'version-bootloader'                      OKAY [  0.060s]
Checking 'version-baseband'                        OKAY [  0.060s]
Setting current slot to 'a'                        OKAY [  0.074s]
extracting boot.img (64 MB) to disk... took 0.285s
archive does not contain 'boot.sig'
Sending 'boot_a' (65536 KB)                        OKAY [  1.530s]
Writing 'boot_a'                                   OKAY [  0.313s]
extracting dtbo.img (8 MB) to disk... took 0.032s
archive does not contain 'dtbo.sig'
Sending 'dtbo_a' (8192 KB)                         OKAY [  0.280s]
Writing 'dtbo_a'                                   OKAY [  0.093s]
archive does not contain 'dt.img'
archive does not contain 'recovery.img'
extracting vbmeta.img (0 MB) to disk... took 0.000s
archive does not contain 'vbmeta.sig'
Sending 'vbmeta_a' (4 KB)                          OKAY [  0.120s]
Writing 'vbmeta_a'                                 OKAY [  0.063s]
archive does not contain 'vbmeta_system.img'
extracting super_empty.img (0 MB) to disk... took 0.000s
Rebooting into fastboot                            OKAY [  0.060s]
< waiting for any device >
Sending 'system_a' (4 KB)                          OKAY [  0.001s]
Updating super partition                           OKAY [  0.019s]
Resizing 'product_a'                               OKAY [  0.006s]
Resizing 'system_a'                                OKAY [  0.005s]
Resizing 'vendor_a'                                OKAY [  0.004s]
archive does not contain 'boot_other.img'
archive does not contain 'odm.img'
extracting product.img (1823 MB) to disk... took 10.203s
archive does not contain 'product.sig'
Resizing 'product_a'                               OKAY [  0.006s]
Sending sparse 'product_a' 1/4 (524284 KB)         OKAY [ 12.887s]
Writing 'product_a'                                OKAY [  2.312s]
Sending sparse 'product_a' 2/4 (524284 KB)         OKAY [ 12.509s]
Writing 'product_a'                                OKAY [  2.323s]
Sending sparse 'product_a' 3/4 (524284 KB)         OKAY [ 13.111s]
Writing 'product_a'                                OKAY [  2.376s]
Sending sparse 'product_a' 4/4 (294452 KB)         OKAY [  8.687s]
Writing 'product_a'                                OKAY [  1.459s]
archive does not contain 'product_services.img'
extracting system.img (866 MB) to disk... took 10.010s
archive does not contain 'system.sig'
Resizing 'system_a'                                OKAY [  0.006s]
Sending sparse 'system_a' 1/2 (524284 KB)          OKAY [ 13.479s]
Writing 'system_a'                                 OKAY [  2.355s]
Sending sparse 'system_a' 2/2 (362948 KB)          OKAY [  9.694s]
Writing 'system_a'                                 OKAY [  1.699s]
extracting system_other.img (151 MB) to disk... took 1.189s
archive does not contain 'system.sig'
Sending 'system_b' (154848 KB)                     OKAY [  3.491s]
Writing 'system_b'                                 OKAY [  0.759s]
extracting vendor.img (430 MB) to disk... took 3.720s
archive does not contain 'vendor.sig'
Resizing 'vendor_a'                                OKAY [  0.004s]
Sending 'vendor_a' (441176 KB)                     OKAY [ 11.592s]
Writing 'vendor_a'                                 OKAY [  1.974s]
archive does not contain 'vendor_other.img'
Erasing 'userdata'                                 OKAY [  4.050s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata'                                 OKAY [  0.007s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 153.317s
(base) alicedembp:platform-tools alice$ 

g、完成后,设备将重新启动。已经刷机成功,看到系统升级到最新Android Q

f、安全起见,再对设备进行加锁

fastboot flashing lock

至此,刷机完毕。

 

你可能感兴趣的:(Android开发)