Install Cygwin under Windows, you can also download the Android source code via Cygwin in Windows through the download steps in this article.
Here are the steps to download Google Android4.4 source under Ubuntu:
1. Install Curl and Git
sudo apt-get Install Curl
sudo apt-get install Git-core
2 Installing Repo
A) set up the repo installation directory and configure environment variables
$ mkdir ~/bin
$ Path=~/bin: $PATH
b) Get Repo tool
$ Curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Question: The above is the Google-made repo get address, but the acquisition may fail.
Solution: Online users have given the alternative to obtain the address, such as error can be replaced by the following address:
Curl "Http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo (I am using this, available)
Then change the permissions:
$ chmod a+x ~/bin/repo
3 Create and enter the source download directory
$ mkdir working_directory
$ CD Working_directory
4 Initializing source Repo
If the current code is downloaded, then:
Repo Init-u https://android.googlesource.com/platform/manifest
To download the code for a specific Android-mature version of the branch, add the-b parameter, such as the currently newly released Android 4.4 branch code:
Repo Init-u https://android.googlesource.com/platform/manifest-b ANDROID-4.4.1_R1
Commands such as smooth execution, the period will require input unsername and email, directly enter their own custom user name and email.
5 Synchronizing full source code
$ repo Sync
Issue: The command may be error-related during execution:
Fatal: '. /platform/abi/cpp.git ' does not appear to be a git repository
Fatal:the remote end hung up unexpectedly
Error:cannot Fetch Platform/abi/cpp
Workaround:
Go to working_directory, show hidden files, see. Repo directory and open manifest.xml, find the Fetch attribute and modify it to:
Fetch= "git://android.git.linaro.org
The Repo Sync command is generally not a one-time success during execution, may be timed out in the middle or there are other failures, and the previous record is cached by simply performing repo sync again.
Reference Document: http://blog.csdn.net/droidpioneer/article/details/24738353