How to download android source code in Ubuntu Linux

Source: Internet
Author: User

1. On a Linux terminal, run the following command to create an android directory under the user directory and enter the directory:
 
Flat view printing? 1 mkdir android
 
2 cd android
 
2. Create the bin directory in android to execute the command:
 
Flat view printing? 1 mkdir bin
 
3. Add it to the environment variable PATH (this step can be skipped and will be described in step 1 ):
 
Flat view printing? 1 PATH = ~ /Android/bin: $ PATH
 
4. Go to the bin directory, download the Repo script, and set it to executable:
 
Flat view printing? 1 curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> repo
 
2 chmod a + x repo
 
Wait a moment.
 
5. Create the source directory for storing the android source code in the android directory and initialize it:
 
 
Flat view printing? 1 repo init-u https://android.googlesource.com/platform/manifest
 
This command downloads all versions. You can also add parameters to the preceding command to specify the source code to be downloaded. For example:
 
Flat view printing? 1 repo init-u https://android.googlesource.com/platform/manifest-B android-4.0.3_r1
 
If the previous step 3rd is skipped, you need to change "repo" in the above command to "../bin/repo" so that the terminal can recognize the repo command.
 
6. the user name and email address are required. You can enter them randomly. If you want to submit a bug to google in the future, you need to enter a valid google account. If "repo initialized in/home/taskiller/android" is displayed, the initialization is complete and the source code can be downloaded.
 
7. In the source directory, enter the repo sync command to download the source code. This speed may take a long time.
 
8. If you only want to download the source code of the kernel, you can create the kernel directory after Step 1 and enter the directory:
 
Flat view printing? 1 mkdir kernel
 
2 cd kernel
 
Then, run the following command to download the file:
1 git clone https://android.googlesource.com/kernel/common.git
 
2 git clone https://android.googlesource.com/kernel/goldfish.git
 
3 git clone https://android.googlesource.com/kernel/msm.git
 
4 git clone https://android.googlesource.com/kernel/omap.git
 
5 git clone https://android.googlesource.com/kernel/samsung.git
 
6 git clone https://android.googlesource.com/kernel/tegra.git
 
This step can be done at the same time as the download source code. The kernel source code is much smaller than the complete source code, and the time required is much smaller. The downloaded files cannot be seen by using the ls command, because they are hidden by default. They are saved in a hidden file named. git and can be viewed through la-la.
 
The compilation of the android kernel and source code will be introduced later.
Readers can also refer to the official website: http://source.android.com/source/downloading.html
 
If not stated, the articles on this site are original articles of Taskiller
 

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.