1. Download Ubuntu system, recommend more than 16.04 version;
2. Git: Git is used when using the Repo tool, to pre-install GIT, use the command: sudo apt-get install git
3. After installing git, configure git, set up git email and username
(1) Git config--global user.email "your email"
(2) git config--global user.name "your name"
4. Install Curl (open source file Transfer tool), using the command: sudo apt-get install curl-y
5. Important Link: Download repo
After downloading repo, set the path of the repo to the environment variable and change the permissions to the executable
mkdir ~/bin
Path=~/bin: $PATH
Curl Https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
6. Then create a new directory to place the Android source code, and enter the directory as follows:
(1) mkdir Android
(2) CD Android
7. Initialize with repo
Repo Init-u git://mirrors.ustc.edu.cn/aosp/platform/manifest
If the prompt cannot connect to gerrit.googlesource.com, you can edit the ~/bin/repo and replace the Repo_url line with:
Repo_url = ' Https://mirrors.tuna.tsinghua.edu.cn/git/git-repo '
If you only want to download a specific version of Android, you can use the following command:
Repo init-u git://mirrors.ustc.edu.cn/aosp/platform/manifest-b Android Version (example: Android-7.1.1_r13)
8. Download the code, the command is as follows (note: This process is time consuming)
Repo Sync
Précis-writers ubuntu download Android source code