Download Android source code using repo in Windows

Source: Internet
Author: User

First, let's take a look at what repo is. We know the code of the android open-source project and use a repo tool to effectively manage hundreds of git projects under android. In fact, repo is not a program, but a script project... and git is the real version management tool. To put it bluntly, repo is a bunch of batch processing (written in Python). It encapsulates git commands reasonably and aims to manage multiple git projects at the same time.

The source code of Android is managed in multiple parts. For example, if you want to view the source code of bootloader, you can run git clone git: // android.git.kernel.org/kernel/lk.git to clone the source code of bootloader, however, there are too many Android modules. If you want to clone the source code of the entire android project, it would be too difficult to download the source code of the entire project one by one. So Google made a Python script to download the source code of the entire project, however, this script requires a Linux environment. If you want to use it in Windows, you must build a simulated Linux environment. There are several simulated environments, you can search for it on the Internet. Here we use cygwin to build it. This is very simple.

1. Install cygwin

Download cygwin and go to the next step (Note: if you install cygwin for the first time, select install from Internet

Then, select the installation location, the location of the temporary file, and the settings for connecting to the network. the key step is to select the library and program to be installed. The following are the installation:

Net-> curl

Devel-> git, Git-completion, Git-Gui, gitk

Libs-> libreadline6, libiconv2

Editors-> Vim

Python-> Python

If not, you can search on the search.

2. Download Repo

Start cygwin, then CD/bin, switch to the bin directory and run the curl http://android.git.kernel.org/repo>./repo to download repo to the bin directory.

Chmod A + x repo grants it executable permissions.

3. Use repo to download Android source code

Switch to user directory

Cd ~

Create a directory for storing source code (the directory name is random)

Mkdir androidsource

CD androidsource

Set Repo

Repo init-u git: // android.git.kernel.org/platform/manifest.git (this process will allow you to enter a nickname and a Gmail mailbox)

Capture Android source code

Repo sync (this time may be longer, which depends on your network speed ).

After the download is complete, you can see the source code in the androidsource directory.

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.