I downloaded the android source code in ubuntu for several months on and off. I hope you will not learn from me! One-time processing!
Here are some suggestions for you. If you are reading a book, the date of reading the book is basically invalid for more than one year. The online version is also unavailable, especially in China.
Step 1:
Change hosts
This step may not be necessary, but in case it is changed, there is no loss!
$sudo gedit /etc/hosts
Add the following content:
74.125.31.82 www.googlesource.com
74.125.31.82 android.googlesource.com
203.208.46.172 cache.pack.google.com
59.24.3.173cache.pack.google.com
Save and close.
Step 2:
Create a "bin" folder in your home directory (/home/xxx/) (Other names can also be used, but I have not tried it) and add it to the system environment variables;
$ mkdir ~/bin$ PATH=~/bin:$PATH
Step 3:
Add download tool:
$ sudo apt-get install curl$ sudo apt-get install git-core
Step 4:
Download the repo execution script file and grant the executable permission.
Official website (http://source.android.com/source/downloading.html) to the address is:
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
But how do not move down, in the article (http://blog.csdn.net/legendof1991/article/details/17005849) with this URL:
$ curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo
Yes. You can choose either of the two!
Grant executable permissions:
$ chmod a+x ~/bin/repo
PS: Actually, this is a script file written by Google to automatically download the source code. You only need to execute it to get the source code file in the current directory;
Step 5:
Create a directory to save the android source code and enter the directory:
$ mkdir myandroid
$ sudo chmod –R 777 myandroid
$ cd myandroid
Step 6:
Initialize the script file to obtain the download list:
A. Obtain all source code:
$ repo init -u https://android.googlesource.com/platform/manifest
B. Obtain the source code of the specified android version, such as android4.0.1:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
PS: to obtain the version information, go to: Release.
Step 7:
Start to get the source code:
$ repo sync
If the command is interrupted, run the command again. Execute this command repeatedly!
If the problem persists, run the "repo sync" command again. Of course, the premise is to ensure that steps 5 and 6 are successfully executed!
Wish you success!
Android/platform/manifestBranches
- Masterandroid-1.6_r1android-1.6_r1.1android-1.6_r1.2android-1.6_r1.3android-1.6_r1.4android-1.6_r1.5android-1.6_r2android-2.0.1_r1android-2.0_r1android-2.1_r1android-2.1_r2android-2.1_r2.1pandroid-2.1_r2.1p2android-2.1_r2.1sandroid-2.2.1_r1android-2.2.1_r2android-2.2.2_r1android-2.2.3_r1android-2.2.3_r2android-2.2.3_r2.1android-2.2_r1android-2.2_r1.1android-2.2_r1.2android-2.2_r1.3android-2.3.1_r1android-2.3.2_r1android-2.3.3_r1android-2.3.3_r1.1android-2.3.4_r0.9android-2.3.4_r1android-2.3.5_r1android-2.3.6_r0.9android-2.3.6_r1android-2.3.7_r1android-2.3_r1android-4.0.1_r1android-4.0.1_r1.1android-4.0.1_r1.2android-4.0.2_r1android-4.0.3_r1android-4.0.3_r1.1android-4.0.4_r1android-4.0.4_r1.1android-4.0.4_r1.2android-4.0.4_r2android-4.0.4_r2.1android-4.1.1_r1android-4.1.1_r1.1android-4.1.1_r2android-4.1.1_r3android-4.1.1_r4android-4.1.1_r5android-4.1.1_r6android-4.1.1_r6.1android-4.1.2_r1android-4.1.2_r2android-4.1.2_r2.1android-4.2.1_r1android-4.2.1_r1.1android-4.2.1_r1.2android-4.2.2_r1android-4.2.2_r1.1android-4.2.2_r1.2android-4.2.2_r1.2bandroid-4.2_r1android-4.3.1_r1android-4.3_r0.9android-4.3_r0.9.1android-4.3_r1android-4.3_r1.1android-4.3_r2android-4.3_r2.1android-4.3_r2.2android-4.3_r2.2-ctsandroid-4.3_r2.3android-4.3_r3android-4.3_r3.1android-4.4.1_r1android-4.4.2_r1android-4.4_r1android-4.4_r1.1android-4.4_r1.2android-cts-2.2_r8android-cts-2.3_r10android-cts-2.3_r11android-cts-2.3_r12android-cts-4.0.3_r1android-cts-4.0.3_r2android-cts-4.0_r1android-cts-4.1_r1android-cts-4.1_r2android-cts-4.2_r2android-cts-verifier-4.0.3_r1android-cts-verifier-4.0_r1android-sdk-4.0.3-tools_r1android-sdk-4.0.3_r1android-sdk-4.4.2_r1android-sdk-adt_r16.0.1android-sdk-adt_r20android-sdk-support_r11froyogingerbreadgingerbread-releaseics-mr0ics-mr1ics-plus-aospidea133jb-devjb-mr1-devjb-mr1-dev-plus-aospjb-mr1.1-devjb-mr1.1-dev-plus-aospjb-mr2-devjumper-stablekitkat-cts-devkitkat-devmaster-dalvikmaster-dalvik-hosttools-canary-releasetools_ndk_r9dtools_r20tools_r21tools_r21.1tools_r22tools_r22.2tools_r22.6tradefedub-tools-idea133Tags
Android-sdk-4.4.2_r1android-4.4.2_r1android-4.4.1_r1android-cts-4.4_r1android-4.4_r1.2android-4.4_r1.1android-4.4_r1android-4.3.1_r1android-4.3_r2.3android-4.3_r3.1android-4.3_r3android-4.3_r2.2android-4.3_r1.1android-4.3_r2.1 _ android-4.3_r2_android-4.3_r1_android-4.3_r0.9.1_android-4.3_r0.9_android-4.3_r2.1_android-4.3_r2android-4.3_r1android-4.3_r0.9.1android-4.3_r0.9android-4.1.2_r2.1android-4.1.2_r2android-4.2.2_r1.2android-4.2.2_r1.1android-cts-4.2_r2android-cts-4.1_r2android-4.2.2_r1_android-4.2.1_r1.2android-4.2.1_r1.1android-sdk-support_r11android-4.2_r1 ___ android-4.2.1_r1 _ android-4.1.1_r6.1android-4.1.2_r1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-cts-4.1_r1android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1_android-4.1.1_r1android-sdk-adt_r20android-4.0.4_r2.1android-4.0.4_r2android-4.0.4_r1.2android-4.0.4_r1android-4.0.3_r1.1android-cts-4.0.3_r2android-cts-verifier-4.0.3_r1android-cts-4.0.3_r1android-2.2.3_r2.1android-4.0.4_r1.1android-cts-2.3_r12android-cts-verifier-4.0_r1android-cts-4.0_r1android-cts-2.3_r11android-cts-2.3_r10android-cts-2.2_r8android-sdk-4.0.3-tools_r1android-sdk-4.0.3_r1android-sdk-adt_r16.0.1android-4.0.2_r1android-4.0.1_r1.1android-4.0.3_r1android-4.0.1_r1.2android-2.2.3_r2android-2.2.3_r1android-4.0.1_r1android-2.1_r2.1p2_android-2.1_r2.1p_android-2.1_r2.1s_android-2.1_r2_android-2.1_r1_android-2.0.1_r1_android-2.0_r1_android-1.6_r1_android-1.6_r1.1_android-1.6_r1.2_android-1.6_r1.3_android-1.6_r1.4_android-1.6_r1.5_android-1.6_r2_android-2.2.2_r1_android-2.2.1_r2_android-2.2.1_r1_android-2.2_r1.3_android-2.2_r1.2_android-2.2_r1.1_android-2.2_r1_android-2.3.5_r1_android-2.3.4_r1_android-2.3.4_r0.9_android-2.3.3_r1.1_android-2.3.3_r1_android-2.3.2_r1_android-2.3.1_r1_android-2.3_r1_android-2.3.6_r0.9android-2.3.6_r1android-2.3.7_r1