Download full source code and sub-module source code for Android 4.4

Source: Internet
Author: User

Blog "Download Android source code-download a single directory using git clone" describes how to download the source code of a single Android directory using git clone. This article has been around for four years, during this period, Google has made changes to the source code management website, and the original method of downloading the source code has become invalid. This article describes how to download the latest full set of Android 4.4 source code and the source code of a single self-module under ubuntu, you can download the full set of Android source code or download the sub-module for source code analysis and compilation. There are many problems encountered during downloading errors. The solution to these problems is of great reference for everyone to obtain the source password.
Go to the official Google source code help page: http://source.android.com/source/initializing.html. Download the source code as described on this page.
The following describes the download steps and solutions to problems.
1. Install Repo
A) create a Repo installation directory and configure Environment Variables

$ Mkdir ~ /Bin

$ PATH=~/bin:$PATH

B) obtain the Repo Tool

$ Curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~ /Bin/repoProblem: The above is the repo address set by Google, but the retrieval may fail.Solution: Online some netizens give alternative to get the address, in case of an error available below address substitution: curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"> ~ /Bin/repo
2. Create and enter the source code download directory.
$ mkdir WORKING_DIRECTORY$ cd WORKING_DIRECTORY
3. initialize source code Repo
If you download the latest code:
Repo init-u https://android.googlesource.com/platform/manifest is to download the code of a specific mature version of Android branch, plus-B parameters, such as the latest release of android 4.4 branch code:
  repo init -u https://android.googlesource.com/platform/manifest -b If the android-4.4.1_r1 command is executed smoothly, you will be asked to enter the unsername and email, directly enter your custom user name and email.Problem: During the init fault, the following 443 connection failure error may occur: error: Failed connect to android.googlesource.com: 443Solution: Find the/etc/hosts file and add the following address (if the file cannot be saved, you must use the root permission to modify the access permission of the hosts file ): the address above 74.125.128.82 android.googlesource.com 74.125.31.82 www.googlesource.com 255.255.173.194.74.82 gerrit.googlesource.com may change. Run the ping command on the terminal to ping the current IP address of each domain name:
E.g.: ping android.googlesource.com
 4. Synchronize the full set of source code
 $ repo sync
Problem: An error may be reported during command 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 
Solution:
Find the fetch attribute in manifest. xml in the. repo directory downloaded after init is successful, and modify it:
Fetch = "git: // Android.git.linaro.org /"

The repo sync command is generally not successful at one time during execution, and may time out or have other failures in the middle. In this case, you only need to execute repo sync again, and the previous records will be cached.

 5. Synchronize sub-module code
The repo syn command is a full set of code for synchronization of the developed branches. However, the execution of the full set of code is very long. Sometimes, you do not need the full set of code but only the code of the specific sub-module. To obtain the sub-module, add the git node Directory Name of the sub-module after the repo sync command. For example, to obtain the source code of the Launcher3 module:
Repo sync packages/apps/Launcher3:
In manifest. xml under the. repo directory downloaded after init is successful, find the project attribute of the sub-module: git directory of e.g. Launcher 3 :...
                                                                                                    
                                                                                                  
                                                                                                   
Path = "packages/apps/Launcher3"Name = "platform/packages/apps/Launcher3"/>
                                                                                                   ... **************************************** **************************************** **************************************** *****************/
                                                                                                  

This article is an original article, and the source must be noted for reprinting:Http://blog.csdn.net/droidpioneer/article/details/24738353

My mobile phone stores and links to Android development Devices: Http://vpclub.octech.com.cn/ztewd/9495.html

/*************************************** **************************************** ****************************************

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.