源碼下載
- 軟件下載
sudo apt-get updatesudo apt-get install gitsudo apt-get install curlsudo apt-get install adbsudo apt-get install reposudo apt-get install vimsudo apt-get install -y git devscripts equivs config-package-dev debhelper-compat golang curl
- 配置git
al user.name "hello"
git config --global user.email "hello@qq.com"
- 下載repo腳本工具
mkdir aosp
cd aosp
mkdir bin
curl https://storage.googleapis.com/git-repo-downloads/repo> bin/repo
chmod a+x bin/repo
- 切換清華源
https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
bin/repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-14.0.0_r45
- 開始同步
bin/repo sync -j4
編譯
cd /home/xxx/aosp
vim build/make/target/product/AndroidProducts.mk
//在最后一行添加:sdk_phone_x86_64-eng \
source build/envsetup.sh
lunch ${編號}
make -j8
編譯錯誤解決
prebuilts/clang/host/linux-x86/clang-3289846/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
sudo ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5
sudo ln -s /lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/libncurses.so.5