Today in download Andriod source code, special to share my experience with you. Of course, the online teaching to download the source of more tutorials, this article is mainly for the download source under the GFW of the various problems of the solution.
1, first install the download client git, curl.
The command is as follows:
sudo apt-get install culr git
2. Create a bin directory and add it to path.
mkdir ~/binpath=~/bin: $PATH
3. Download the repo script and add executable permissions.
Curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repochmod a+x ~/bin/repo
Here, the problem comes out. Since the end of May, Google's related sites, basically have been unable to directly access, of course, I have been using goagent to turn the wall, the impact is not small, in addition to open tools.android.com this site. Here, I assume you already have a proxy tool (if not, will toss with goagent, will not toss the one months to spend a few dollars to buy one). Here we need to set the Curl code, the method is simple, add a parameter-X proxy address. For example, my proxy server for my other computer on the LAN, the IP is 192.168.137.1, the port is 8087. Then the command to download the repo script above should be:
Curl-x 192.168.137.1:8087 http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo
After downloading, modify the permissions as shown above.
4, create a directory for download andriod source code. then enter the directory.
5, initialize the repo.
Repo Init-u https://android.googlesource.com/platform/manifest
No accident, here comes the problem again. Googlesource.com site is wall, so here cannot download directly, need to set code. Here the code is very simple, set the Https.proxy variable is enough. As follows:
Export https_proxy=192.168.137.1:8087
Back to the corresponding value remember to change back to your own proxy server address and port.
(Complement, HTTP proxy also to set, the following download code will use, the same way, set the Http_proxy variable. )
Then we perform the initialization again. At this point, the problem comes again, the console output:
Get Https://code.google.com/p/git-repo/error:server Certificate verification failed. Cafile:/etc/ssl/certs/ca-certificates.crt Crlfile:none while accessing https://code.google.com/p/git-repo/info/ Refsfatal:http request failed
The display is a certificate issue. Import Certificate I don't know how to do it, but I found another way to do that is to cancel the SSL verification of Git. The command is as follows:
Export Git_ssl_no_verify=1
Then we perform the initialization again, and then it succeeds (if the network disconnects please try again).
6, finally, the implementation of repo sync can be.