Android source code Download Method

Source: Internet
Author: User

Download Android source code

When downloading the android source code for the first time, you will inevitably encounter some small issues, such as so.

If the English is good, you can directly look at this: http://source.android.com/source/downloading.html

1. Create a folder for your source code:

$ mkdir ~/bin$ PATH=~/bin:$PATH

Ii. Download tool repo

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo

Possible problems: download failure or download failure

Solution: Change

$ Curl http://git-repo.googlecode.com/files/repo-1.12> ~ /Bin/repo

Or:

$ Curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo">./repo // get repo



3. Find a place with a large space and put the source code to be downloaded,

$ mkdir YOU——WORK_NAME$ cd YOUR——WORK_NAME

IV, Repo init initialization code repository

$./Repo init-u https://android.googlesource.com/platform/manifest



5. Download source code

$ repo sync
Possible problems: connection failure or download interruption

Solution:

Locate the fetch attribute in manifest. xml under the. repo directory
Change
Fetch = "git: // Android.git.linaro.org/" or fetch = "https://android.googlesource.com/" (the latter is said to download fast, unverified)

For interruptions, you can write a brother script as follows:

Create script download. sh

#! /Bin/bash

Echo "========= start repo sync ===================="

./Repo sync

While [$? = 1]; do

Echo "===== sync failed, re-sync again ====="

Sleep 3

./Repo sync

Done

Remember that chomd a + x download. sh allows it to run.



Tip: the download takes a long time. You can set up a PC Download at night.


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.