Start, Aosp build

This article was last updated on <span id="expire-date"></span> days ago, the information described in the article may be outdated.

AOSP(Android Open Source Project),Android开放源代码项目,开放源代码项目(AOSP),由谷歌发起。开始–Aosp的环境与构建

安装构建依赖包

1
bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev libwxgtk3.0

Repo与git(清华源)

1
2
3
4
5
6
7
8
9
10
11
将bin文件夹添加到环境变量中
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

清华源
mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o ~/bin/repo
chmod a+x ~/bin/repo

同步源码

1
2
3
4
5
6
7
8
9
10
11
修改清华源
git config --global url.https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/.insteadof https://android.googlesource.com

根据项目需求
Sync...
设置邮箱用户名
git config --global user.email "邮箱"
git config --global user.name "用户名"
根据项目需求
repo Sync
repo sync -c -j8$(nproc --all) --force-sync --no-clone-bundle --no-tags

为Git-repo设置代理

1
2
3
4
5
6
Repo
export http_proxy=http://127.0.0.1:8889
export https_proxy=https://127.0.0.1:8889
Git
git config --global http.proxy http://127.0.0.1:8889
git config --global https.proxy https://127.0.0.1:8889

取消Git代理

1
2
git config --global --unset http.proxy
git config --global --unset https.proxy

Author: oGnok

Permalink: http://lovelypanda.top/2023/09/24/aospbuild/