1.概述
通用系统映像 (GSI) 是一种纯 Android 实现,采用未经修改的 Android 开源项目 (AOSP) 代码,可在各种 Android 设备上运行。
2.下载GSI
通用系统映像 (GSI) | Platform | Android Developers
3.刷入GSI img
下载GSI之后,里面会有system.img,需要把这个img刷入设备
adb reboot-bootloader
fastboot flashing unlock
fastboot reboot-fastboot
fastboot flash system system.img
fastboot -w :清空data分区
fastboot reboot
4.GSI fail案例
run cts-on-gsi -m CtsLibcoreTestCases有两条fail项
Test | Result | Details |
libcore.java.text.DateFormatTest#testFormat_forBug266731719 | fail | junit.framework.ComparisonFailure: expected:<Jan 1, 2023 [9:55:48 PM]> but was:<Jan 1, 2023 [21:55:48]> |
libcore.java.text.DateFormatTest#testParse_lenient_en | fail | junit.framework.AssertionFailedError: expected:<1672610148000> but was:<1672566948000> |
可以运行run cts-on-gsi -m CtsLibcoreTestCases来测试是否有fail项,也可以通过run cts-on-gsi -m CtsLibcoreTestCases -t libcore.java.text.DateFormatTest#testParse_lenient_en命令来运行某一条case
上面的问题很明显,打开了24小时制导致。