Android 4.4 Full set of source code and sub-module source code download method

Source: Internet
Author: User

Blog "android source download-a single directory download with Git clone" describes the use of Git clone method to download android single directory source code, this article has four years of history, during which Google's source code management site has been changed, Downloading the source code directly using the original method is invalid. This article describes under Ubuntu (installed under Windows Cygwin, through the Cygwin can also be downloaded in Windows through this article download the Android source code) to obtain the current latest Android 4.4 full set of source code and a single self-module source code download method, According to this method can download a full set or download only sub-module Android source code for source analysis and compilation. Download fault encountered many problems, the resolution of these problems for everyone to obtain the source password is very useful for reference.
Google Source's official help page: http://source.android.com/source/initializing.html, download the source code follow the steps described on this page.
Below is a brief description of the steps to download and the solution to the problem.
1, installation 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 问题:上面是Google制定的repo获取地址,但获取可能失败。 解决办法:网上有网友给出了替代的获取地址,如遇报错可用下面的地址替代: curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo
2、建立并进入源码下载目录
$ mkdir WORKING_DIRECTORY$ cd WORKING_DIRECTORY
3, initialize the source code repo
If the current code is downloaded, then:
 repo init -u https://android.googlesource.com/platform/manifest 如是下载特定Android成熟版本分支的代码,则加上-b 参数,如当前最新发布的android 4.4分支代码:
 repo init -u https://android.googlesource.com/platform/manifest -b ANDROID-4.4.1_R1 command, such as smooth execution, the period will be required to enter unsername and email, directly enter their own custom user name and email.problem: In the Init fault, the following 443 connection failure error may occur: Error:failed Connect to android.googlesource.com:443Solutions: Locate the/etc/hosts file and add the following address (if you cannot save the access permission to modify the Hosts file with root privileges): 74.125.128.82 android.googlesource.com 74.125.31.82 Www.go oglesource.com 203.208.46.172 cache.pack.google.com 173.194.74.82 gerrit.googlesource.com The above address may change, before saving in the terminal with PI The NG command pings the current IP address substitutions for each domain name individually:
e.g.: Ping android.googlesource.com
 4、同步全套源代码 
 $ repo sync
  Problem
  Workaround :
In the manifest.xml in the. Repo directory that was downloaded after Init succeeded, 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.

 5、同步子模块代码
 repo syn命令是同步所制定分支的全套代码,但全套代码的执行过程很长,有时候也并不需要全套代码而只需要特定子模块的代码。 获取子模块的方法是在repo sync 命令后加上子模块的git节点目录名即可,例如想要获取Launcher3模块的源代码:
 repo sync packages/apps/Launcher3 各个子模块的节点目录查找方法: 
 在init成功后下载的.repo目录下的manifest.xml里,找到子模块的project 属性即可: e.g. Launcher 3 的git目录: ... <project path="packages/apps/Launcher2" name="platform/packages/apps/Launcher2" />  <project path="packages/apps/Launcher3" name="platform/packages/apps/Launcher3" />  <project path="packages/apps/LegacyCamera" name="platform/packages/apps/LegacyCamera" /> ...
my mobile store, welcome crossing :http://vpclub.octech.com.cn/ztewd/9495.html

This article is original article, reprint please indicate source: Http://blog.csdn.net/droidpioneer

Android 4.4 Full set of source code and sub-module source code download method

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.