To download the source code, you first need to install the following software: Curl and Git-core 1.1 Install Curl:
Execute in Terminal: $sudo apt-get Install Curl 1.2 installation Git-core
1.2. 1 Create a new bin file in the user directory to execute in the terminal: mkdir ~/bin
Add the ~/BIN environment variable, the role is: To download the GIT software installed in this directory, run in another directory may not find the software, so to be added to the environment variable in the terminal execution: Path=~/bin: $PATH 1.2.2 Installation Git-core
Execute in Terminal: Curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo§> ~/bin/repo
Execute permissions for repo: chmod a+x ~/bin/repo 1.3 Download source code
1.3. 1 Enter the directory to which you want the source code to be saved, such as my source:,/OPT/ANDROID/SRC
Execute in Terminal: CD/OPT/ANDROID/SRC into src directory 1.3.2 get repo latest configuration
Repo Init-u https://android.googlesource.com/platform/manifest§ If you perform an error, use the following command:
~/bin/repo init-u https://android.googlesource.com/platform/manifest§1.3.3 Download source code
For downloading different versions of Android, specify a manifest branch (that is, only the version of Android), use the-B parameter (that is, download a version of the source code), for example: For version 4.2, change the command to
Repo Init-u https://android.googlesource.com/platform/manifest§-b ANDROID-4.2_R1 If an error is performed, use the following command:
var script = document.createelement (' script '); SCRIPT.SRC = ' http://static.pay.baidu.com/resource/baichuan/ns.js '; Document.body.appendChild (script);
~/bin/repo Init-u Https://android.googlesource.com/platform/manifest§-b
Android-4.2_r1
After executing the above command, a. Repo directory is generated in the/OPT/ANDROID/SRC directory, which holds information about the source code that will be downloaded
Sync get source #~/bin/repo sync
If there is an interruption in the middle, this is normal, you can enter the ~/bin/repo Sync command again to download.
According to the different speed, download time also has speed, preferably before bedtime or after work to download code, because the source file is relatively large, the general domestic are about 5 hours or even longer.
If the following message appears, the code is downloaded: fetching projects:100% (166/166), done. Syncing work tree:100% (165/165), done.
Run ~/bin/repo Sync can also re-proofread the downloaded source code, if there is a problem or missing some files will be re-downloaded and exported from the. Repo directory to the actual source code
These already represent us to enter a deep level, must study well.
Android system porting and driver development case