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

Source: Internet
Author: User
Tags ubuntu touch

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

In the past, you can use the git clone method to download the source code of a single Android directory. However, Google has made changes to the source code management website and direct use of the source code has become invalid. This article describes how to install Cygwin In Ubuntu (in Windows, Cygwin can also be used in Windows to download the Android source code through the download steps in this article) to obtain the latest full source code of Android 4.4 and the download method of a single self-Module source code, you can download the full set or only download the Android source code of 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.

Android 4.4.4 release and download

The simplest Ubuntu Touch & Android dual-System Installation Method

Enable dual-boot for Ubuntu and Android 4.4.2 on Nexus

Configure the Android SDK development environment in Ubuntu 14.04

Build the Android development environment under 64-bit Ubuntu 11.10 (JDK + Eclipse + ADT + Android SDK details)

How to configure the compiling environment of Android 14.04 kitkat on Ubuntu 4.4 x64

Install Android SDK on Ubuntu 12.10x64

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/repo

Problem: The above is the repo address set by Google, but the retrieval may fail.

Solution: some online users provide an alternative address to obtain the address. In case of an error, the following address can be used:

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 the source code Repo if the latest code is downloaded, then: repo init-u https://android.googlesource.com/platform/manifest

If you download the code of a specific Android mature version branch, add the-B parameter, for example, the latest android 4.4 branch code:

Repo init-u https://android.googlesource.com/platform/manifest-B android-4.4.1_r1

If the command is successfully executed, you must enter unsername and email, and enter your custom user name and email.

Problem: The following 443 connection failure error may occur during the init fault:

Error: Failed connect to android.googlesource.com: 443

Solution: 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 ):

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 preceding address may change. Run the ping command on the terminal to ping the current IP address of each domain name to replace: e.g.: ping android.googlesource.com.

4. synchronize full source code $ repo sync

Problem: the following 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: downloaded after successful init. manifest in the repo directory. in xml, locate the fetch attribute and change it to: fetch = "git: // Android.git.linaro.org/" repo sync command will not succeed at one time during execution, timeout or other failures may occur in the middle. 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

Find the node directory of each sub-module: Find the project attribute of the sub-module in manifest. xml under the. repo directory downloaded after init is successful:

Git directory of e.g. Launcher 3:

...
<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"/>
...

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.