There are 3 steps:
- Setup & Download
- Build
- Flash
Before you start, please be calm in any situation :v.
-
At least 250GB of free disk space to check out the code and an extra 150 GB to build it. If you conduct multiple builds, you need additional space.
-
You need
repo
tool to download the source:1/ make sure that you have a
bin/
directory in your home directorymkdir ~/bin PATH=~/bin:$PATH
2/ dowload the Repo Launcher and ensure that it's executable
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo
-
Download:
1/ create an empty directory (aosp or something like that)
mkdir WORKING_DIRECTORY cd WORKING_DIRECTORY
2/ configure Git with your real name and email address
git config --global user.name "Your Name" git config --global user.email "[email protected]"
3/ Run repo init and sync the source
repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r35 repo sync
4/ Dowload Pixel 4 driver https://developers.google.com/android/drivers, please select the driver follow the build name above, this case is QQ2A.200501.001.B2.
- Unzip the downloaded file in the root directory of the code and you will get a sh file, run through the terminal xxx.sh
tar zxvf qcom-flame-qd1a.190821.007-54118c11.tgz -C./ tar xvf google_devices-flame-qd1a.190821.007-2a6a603e.TAR
- After decompression, execute the sh file:
./extract-qcom-flame.sh ./extract-google_devices-flame.sh
- Agree user agreement is required here, you only need to hold down the down key, you can swipe to the end and enter I ACCEPT.
- Install JSK 1.8
sudo apt-get install openjdk-8-jdk
- set up the environment
source build/envsetup.sh
- run lunch command with the target (up to the device), we use aosp_flame-userdebug for pixel 4.
lunch aosp_flame-userdebug
- compile the code, make -jN, N is the number of parallel tasks.
m -j4
-
We will use
fastboot
andadb
tool for this step. If you already have android sdk, please access those tools in Android/Sdk/platform-tools. Otherwise, please install by using this scriptmake fastboot adb
-
Unlock your device
1/ Enable
OEM unlocking
indeveloper option
, please ask me if you don't know where that screen is2/ Reboot into the bootloader and use fastboot to unlock it
fastboot flashing unlock
-
Flashing your device:
1/ Using this script to place the device in
fastboot
modeadb reboot bootloader
2/ After the device is in fastboot mode, you need to set the env variable (ANDROID_PRODUCT_OUT) to the build output
export ANDROID_PRODUCT_OUT=~/AOSP_DIRECTORY/out/target/product/flame
then run
fastboot flashall -w
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt install m4
#AOSP build fails when building on NFS