Pixel3XL 编译源码刷机教程

时间:2025-02-10 06:59:51

买手机

在二手平台买一台已经unlock过后的Pixel手机,这个时候oem锁已经是打开状态。

选择android代码版本

参考 源代码标签和构建
Pixel3XL可以刷的最新的Android版本为android-12.0.0_r34,驱动的版本是SP1A.210812.016.C2。

下载代码和驱动

  • 代码
export REPO_URL="https://gerrit-googlesource.proxy.ustclug.org/git-repo"
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b  android-12.0.0_r34
repo sync -j4
  • 驱动
    地址,下载完成后是两个sh文件

编译源码

source build/envsetup.sh
lunch aosp_crosshatch-userdebug
make -j16

执行驱动脚本

./extract-google_devices-crosshatch.sh
./extract-qcom-crosshatch.sh

刷机

adb reboot fastboot
fastboot flashall -w

注意

设备刷机完成后,你会发现找不到设备,adb devices报以下错误

no permissions (missing udev rules? user is in the plugdev group); ...

这个时候参考这篇文章解决 https://blog.****.net/liyuan_669/article/details/121910580

参考

https://zhuanlan.zhihu.com/p/512669085