Repo download domestic link Android source code

Source: Internet
Author: User

Just meet to download a specific version of the Android source code, not found on the Internet, so only to download, read the official Google download help but suffer from wall convulsions, download speed is also very slow, so find a few domestic source download, then follow me to move up, Before you do, you will need a Linux-equipped computer or a virtual machine with Linux on it.
(a). Popular science The difference between git and repo

     1. Git:Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。   2. Repo: Repo是谷歌用Python脚本写的调用git的一个脚本。主要是用来下载、管理Android项目的软件仓库(也就是说Repo是用来管理给Git管理的一个个仓库的)

so you need to install git before you do the operation, and repo
(b). installing Git and Repo

    1. Installing Git:sudo apt-get Install Git-core
    2. Installing Curl:sudo apt-get Install Git-core Curl
    3. Download repo via Curl:
mkdir ~/binPATH=~/bin:$PATHcurl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo## 如果上述 URL 不可访问,可以用下面的:## curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo

Yes, and then he's going to generate a repo file in the specified directory

(iii). Ready to download

    • Create working directory (this name is optional)
      "'
      mkdir working_directory
      CD working_directory
 -初始化仓库

Repo Init-u git://mirrors.ustc.edu.cn/aosp/platform/manifest
Where Repo init-u https://aosp.tuna.tsinghua.edu.cn/platform/manifest is the source of the image provided by Tsinghua University
Repo Init-u git://mirrors.ustc.edu.cn/aosp/platform/manifest is the mirror source of China University of Science and Technology
If the prompt cannot connect to gerrit.googlesource.com, you can edit the ~/bin/repo file and replace the Repo_url line with the following:
Repo_url = ' Https://gerrit-googlesource.lug.ustc.edu.cn/git-repo '

 - 下载指定android版本(将上面初始化仓库的操作换成)

Repo Init-u git://mirrors.ustc.edu.cn/aosp/platform/manifest-b android-4.0.4_r2.1
"'

Version List

    • Start synchronizing the source tree
      Repo Sync
      Download speed identification diagram

      Download complete

      Download complete in the working directory you can see:
Sync Help

Yes, the file is relatively large, generally in the 10g+, so in the download process will encounter various conditions!
When you need to pause only need Ctrl + C to pause the synchronization, repo is to support the continuation of the breakpoint, shutdown you can also come to the working directory to perform repo sync to continue syncing!
Of course the synchronization process may get stuck regularly, and we can use a script to help

Vim dowmload.sh (if you have not downloaded vim you can perform sudo apt-get install vim for installation, about vim use self-Baidu)
Write the following ancestral code into dowmload.sh:

#!/bin/bash
echo "======start repo sync======"
Repo Sync
While [$ = = 1]; Do
echo "======sync failed, Re-sync again======"
Sleep 3
Repo Sync
Done

CHOMD a+x download.sh Let it run, then terminal input./download.sh can start downloading, replacing the repo sync in the official document with this step. Rest for 3 milliseconds when not connected to the terminal and then automatically repo sync, so you don't have to wait.

Repo download domestic link Android source code

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.