Divided into 4 processes
- SOURCE download
- Building a compilation environment
- Compiling source code
- Run
Source download install git and configure
//安装gitsudo apt-get install git//配置git名称和邮箱git config --global user.name "your name"git config --global user.email "[email protected]"
Create a repo bin directory and source directory
-
Create a bin directory for repo
midir ~/bin
-
Create source Directory
midir ~/source
Installing Repo
Because of the common on-line installation repo method, there Cannot get http://gerrit.googlesource.com/git-repo/clone.bundle is an exception, through the Internet search, because repo need to update their own project, not connected to the project itself git repository, in this, took a manual pull repo the latest project way
-
Pull from Gitrepo项目
git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
-
git-repoCopy the inside repo文件 to~/bin目录
-
~/sourcenew folder in directory, rename to .repo git-repo repo copy to .repo directory
-
will be ~/bin/repo added to the environment variable and given permissions
//赋予权限chmod a+x ~/bin/repo//添加到环境变量将export REPO=~/bin 添加到~/.bash_profile///让配置文件生效source ~/.bash_profile
Download source initialization repository
CD to the ~/source directory, execute the following command
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
or this command.
repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest
The effect of both is consistent, only the agreement is different.
If the prompt fails to connect to gerrit.googlesource.com during the execution of the command, then we just need to edit the ~/bin/repo file, find the Repo_url line, and modify its contents to:
Repo_url = ' Https://gerrit-google.tuna.tsinghua.edu.cn/git-repo '
Then re-execute the above command.
Additional Information
The manifest command without parameters is used to get the most recent code on master, but it can be specified by the-b parameter to get a specific version of Android, for example, if we want to get the ANDROID-4.0.1_R1 branch, the command is as follows:
Repo Init-u https://aosp.tuna.tsinghua.edu.cn/platform/manifest-b ANDROID-4.0.1_R1
(Aosp the current list of all branches of the project see: Branch list)
Synchronizing code
The command is as follows
repo sync
Ubantu16.04 for Android 8.0 source code compilation