I. Overview
As we all know, the Android mobile operating system is launched to all corners of the world on the premise that Google has spent a lot of financial, material, and manpower to openSource code(Of course, it is not completely open to all), so that it can be quickly extended around the world. Although it is only in year 34, it is not necessary to elaborate on it, let's look at the industry news. Here we will mainly discuss the Android system sourceCodeDownload, here we first understand two tools:
1. Git
Git is a tool for Linux kernel management. It is a distributed version control system, that is, each working directory is a complete repository, so it also supports offline work, after local submission, it will be updated to the server later. This structure is more robust than a centralized version control system (for example, a common SVN or CVs with only one full repository.
2. Repo
In fact, repo is only a script written in Python. It aims to better and more conveniently manage multiple components in the Android operating system, multiple projects, such as kernel, dalivk, bionic, prebuild, and build. The purpose of Repo is to manage these projects in a unified manner and simplify the use of git.
3. Curl
Curl is a File Transfer tool that uses the URL syntax in command line mode. Here we use it to obtain the repo script.
Ii. Steps for downloading source code
1. Environment Introduction:
First, introduce my environment: in Windows 7, use vmare 7.1 to virtualize the ubuntu10.4.2 System (of course, the Ubuntu is also installed on the hard disk, but it is not convenient for my Linux system to access the Internet)
2. Procedure:
1) install the GIT Tool
Command:Sudo apt-Get install git
Of course you can also go to the http://git-scm.com to download the latest version of the source code, locally compiled and installed, here is not detailed.
2) install curl:
Command: sudo apt-Get install curl
2) obtain the repo script and grant the execution permission:
I plan to put this script in ~ /Bin directory, and add this directory to the environment variable path to facilitate running Repo
Command: mkdir ~ /Bin
Cd ~ /Bin
Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
Chmod 755 Repo
If ~ After the/bin directory is added to the PATH variable, You can execute repo in any directory.
3) initialize the database
First, create a directory where you want to store the android source code. Here I download it ~ /Under the android_src directory,
Command: mkdir ~ /Android_src
Cd ~ /Android_src
Repo init-u git: // android.git.kernel.org/platform/manifest.git
Repo sync
The above command Retrieves all the source code libraries of the latest version on the current main line. If you only need some of the Code, you can also add the-B [branchname] parameter to obtain the specified branch code.
The download process follows the network conditions. The download process usually takes a long time. I am not sure about the specific time. Generally, the download starts before going to bed at night. In the morning, the download is complete.
Iii. Expansion
To be supplemented...