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
 
                    
                
                
            
        
浙公网安备 33010602011771号