Android-Android系统源码下载2

1.下载源码时候的工具

  • A Linux or Mac OS system. It is also possible to build Android in a virtual machine on unsupported systems such as Windows. If you are running Linux in a virtual machine, you need at least 16GB of RAM/swap and 100GB or more of disk space in order to build the Android tree. See disk size requirements below.
  • A 64-bit environment is required for Gingerbread (2.3.x) and newer versions, including the master branch. You can compile older versions on 32-bit systems.
  • At least 100GB of free disk space for a checkout, 150GB for a single build, and 200GB or more for multiple builds. If you employ ccache, you will need even more space.

  • Python 2.6 -- 2.7, which you can download from python.org.

  • GNU Make 3.81 -- 3.82, which you can download from gnu.org,

  • JDK 7 to build the master branch of Android in the Android Open Source Project (AOSP); JDK 6 to build Gingerbread through KitKat; JDK 5 for Cupcake through Froyo. See Initializing a Build Environment for installation instructions by operating system.

  • Git 1.7 or newer. You can find it at git-scm.com.

分析如下:1你得有Linux系统或者苹果系统 其实Windows系统也是可以的就是麻烦点 2.JDK GNU Git等软件 3.卧槽还要100G的磁盘空间 好吧 我基本要放弃了


Downloading the Source

The Android source tree is located in a Git repository hosted by Google. This document describes how to download the source tree for a specific Android code-line.

Installing Repo


Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see theDeveloping section.

To install Repo:

  1. Make sure you have a bin/ directory in your home directory and that it is included in your path:

    $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    
  2. Download the Repo tool and ensure that it is executable:

    $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo

For version 1.17, the SHA-1 checksum for repo is ddd79b6d5a7807e911b524cb223bc3544b661c28

For version 1.19, the SHA-1 checksum for repo is 92cbad8c880f697b58ed83e348d06619f8098e6c

For version 1.20, the SHA-1 checksum for repo is e197cb48ff4ddda4d11f23940d316e323b29671c

For version 1.21, the SHA-1 checksum for repo is b8bd1804f432ecf1bab730949c82b93b0fc5fede

For version 1.22, the SHA-1 checksum for repo is da0514e484f74648a890c0467d61ca415379f791

Initializing a Repo client


After installing Repo, set up your client to access the Android source repository:

  1. Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:

    $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY
  2. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.

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

    To check out a branch other than "master", specify it with -b. For a list of branches, seeSource Code Tags and Builds.

    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
  3. When prompted, configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.

A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

Downloading the Android Source Tree


To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run

$ repo sync

The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more about repo sync and other Repo commands, see the Developing section.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值