Build AOSP: Pixel 5 (redfin) with Android 13
Environment
- PC
- CPU: i7-12700 (8 P-core + 4 E-core)
- RAM: 32 GB
- Disk: 1 TB SSD
- OS: Ubuntu LTS 22.04 with required packages
- Software
- Phone
Download AOSP source code
Follow official tutorial and choose a tag.
I choose tag android-13.0.0_r67 for my Pixel 5, and the correspoding build ID is TQ3A.230805.001

- Create a folder for AOSP source code
- Init with tag android-13.0.0_r67
- Sync
Download driver binaries
- Download driver binaries according to the AOSP source code build ID and tag. I download binaries with build ID TQ3A.230805.001 for my Pixel 5 according to the tag android-13.0.0_r67.

- Unzip to your AOSP source code folder
- Run script
Build AOSP
Follow official tutorial
- Setup
- Choose a target to lunch. I choose aosp_redfin-userdebug for my Pixel 5.

- Enable compile_commands.json, which let you efficiently trace C/C++ code with VS code installed with clangd extension
- Build all images
Unlock phone
Follow official tutorail
-
Enable OEM unlocking and USB debugging in Developer options

-
Reboot to bootloader

- Unlock

- Flash (Note: fastboot will flash img in $ANDROID_PRODUCT_OUT folder to your phone)
- Boot to Android homescreen

Troubleshooting
If your Pixel phone is bricked, using physical button to force reboot your phone to bootloader, and flash factory img with official tool.
Reference
- https://c55jeremy-tech.blogspot.com/2019/04/aosppixel-2-romrom.html
- https://zhuanlan.zhihu.com/p/574856795
- https://source.android.com/docs/automotive/start/pixelxl
Bluetooth Repository
packages/modules/Bluetooth/
Develope flow
- Modify code
- Build Bluetooth package and dependency
- According to TEST_MAPPING file, use Atest to run instrumentation test, unit test or GTest
- Manual test: replace Bluetooth apex and manually verify your change
- Submit patches
Develop & Debug skill
- Get read/write permission