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

Source: Internet
Author: User
Tags using git

Blog "android source code download-using Git clone to implement a single folder download" introduced the use of Git clone method to download Android single folder source code, this article has four years of history, during which Google's source code management site has been changed , direct use of the original method to download the source code has been invalidated.

This article describes the latest Android 4.4 full source code and a single self-module source code download method under Ubuntu (Install Cygwin under Windows, download Android source code via Cygwin also available in Windows via the download steps in this article). According to this method can download a full set or just download sub-module Android source code for source code analysis and compilation. Download fault encountered a lot of problems, the solution of these problems for everyone to get the source password is very useful for reference.
Google source code official help page : http://source.android.com/source/initializing.html. Download the source code follow the steps described on this page to do so.


The following is a brief description of the steps to download and how to resolve the problem.
1, installation Repo
A) Set up Repo installation folder, 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 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 commands such as smooth operation, the period will require the input of unsername and email. Enter your own defined username and email directly.problem: In the Init fault, there may be 443 connection failure errors such as the following: Error:failed Connect to android.googlesource.com:443How to solve: Locate the/etc/hosts file, add an address such as the following (if you cannot save the access permission to change the Hosts file with root permission): 74.125.128.82 android.googlesource.com 74.125.31.82 www. googlesource.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 The ping command pings the current IP address substitutions for each domain name individually:
e.g.: Ping android.googlesource.com
 4、同步全套源码 
 $ repo sync
  Problem
  The workaround :
In the manifest.xml under the. Repo folder that was downloaded after Init succeeded, find the fetch attribute and change to:
Fetch= "git://android.git.linaro.org/"

The Repo Sync command is generally not successful at one time during operation and may be timed out or otherwise failed in the middle of the run, just need to run repo sync again. The records that were used will be cached.

 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 cell phone store. Welcome you crossing to join :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 source code and sub-module source code download method

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.