Download Android source code

[更新] http://source.android.com/source/downloading.html

新版的地址修改了:  $ repo init -u https://android.googlesource.com/platform/manifest.git

按照官方的文档下载与配置好git以及repo,

$ repo init -u git://android.git.kernel.org/platform/manifest.git

过会儿,在看到init finished后,再运行如下的命令,否则再运行一次上面的命令直到看到成功的提示

$ repo sync

 

以上的命令是下载platform上的主分支,要想下载比如1.6(cupcake)的源码,请运行如下的命令

$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

$ repo sync

 

以上的代码是:android 中的 apps + framewok部分

 

由于下载代码的时间比较长,在下载代码的过程中,有可能会遭遇个别工程无法下载的情况(由于可能存在时差,个别工程会在北京时间的星期天关闭,

因此最好不要在这个时间点,下载源码),或者自己嫌网络慢,以及网速慢等,连接会被远程端关闭等等情况。。。

或者在公司没下完,想回家继续下载,。。。

当要重新开始下载的时候,需要注意的是,需要重新运行一次 repo init -u ...命令

然后再运行 repo sync命令

 

由于 manifest.git 里面步一定能包含 /platform下所有的工程,所以需要修改 .repo(隐藏目录)下的文件manifest.xml

参考: http://geek.gfan.com/aosp-android-2-1-eclair-source-for-htc-g1/ 中的源码下载,需要一一核对看看是不是少了工程

    加入中文的支持,使得界面能够显示中文:

    1)将文件(./build/buildspec.mk.default)拷贝到根目录下 并重新命令为buildspec.mk

    2)

  ifndef CUSTOM_LOCALES
      CUSTOM_LOCALES:=zh_CN
       endif

以上的修改是参考文件(./build/buildspec.mk.default)中的说明:

######################################################################
# This is a do-nothing template file.  To use it, copy it to a file
# named "buildspec.mk" in the root directory, and uncomment or change
# the variables necessary for your desired configuration.  The file
# "buildspec.mk" should never be checked in to source control.
######################################################################

附录:源码分支

 * [new branch]      cupcake    -> origin/cupcake
 * [new branch]      cupcake-release -> origin/cupcake-release
 * [new branch]      donut      -> origin/donut
 * [new branch]      donut-plus-aosp -> origin/donut-plus-aosp
 * [new branch]      eclair     -> origin/eclair
 * [new branch]      froyo      -> origin/froyo
 * [new branch]      froyo-plus-aosp -> origin/froyo-plus-aosp
 * [new branch]      gingerbread -> origin/gingerbread

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值