Aosp: Download Android source code

Source: Internet
Author: User

I'm very glad that today we have a link with the android development website and the source code website. Although it is a bit difficult, it is still worth it !!

 

Summary download source code method, from http://source.android.com/source/downloading.html

 

Before installation, ensure that git and curl are installed. If not, run the following command:

Sudo apt-Get install Git-core curl 

 

Installing Repo

Install the repo script file.


Note: Create the bin directory under your/home/username directory. If you want to use it conveniently, add the directory to the path.

I didn't add it to the path in this way, and directly create the/bin directory under/home/myname.

cd /home/markmkdir bin

Download the repo script and ensure it is executable:

Download the repo script file to the/home/mark/bin directory.

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

Note: If the subsequent operation fails, download the repo file again.

Modify file permissions:

chmod a+x ~/bin/repo

Create a directory named android_src:

cd /home/markmkdir android_src

Go to the android_src directory:

cd android_src

Initialization

~/bin/repo init -u https://android.googlesource.com/platform/manifest

If you want to download the specified source code, you can add a parameter-B:

~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1

Finally, run the following command to download the android source code:

~/bin/repo sync

Wait for the download. If the download fails,Re-Execute ~ /Bin/repo sync

Note: The steps for downloading the android source code are mainly on the official website. The official website provides detailed methods and steps.

In particular, when downloading and installing the repo file, compare the download methods on the official website, download the repo again, and delete the original repo file. Otherwise, you will encounter the following error message:

fatal: unable to connect a socket (Connection refused) 

This is because you have not updated (re-downloaded the repo file) or used the original script file!

 

 

 

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.