Windows环境下Android Sdk源码下载
- 安裝Cygwin 要安裝的packages如下:
Net -> curl
Devel -> git* (git, git-completion, git-gui, gitk)
Libs -> libreadline6, libiconv2
Editors -> vim
Python -> python
- 下载整个源码
(启动Cygwin之后,开始Repo)
$ cd ~
$ mkdir bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~/bin/repo
$ chmod a+x ~/bin/repo
$ cd ~
$ mkdir mydroid
$ cd mydroid
$ ~/bin/repo init -u https://android.googlesource.com/platform/manifest
(需要输入一个已申請Google account的email)
如果cygwin出错:Resource temporarily unavailable。
退出cygwin,找到cygwin目录下的ash.exe,双击运行。执行shell命令
/bin/rebaseall
执行完毕,重新进入cygwin,重新repo init,应该能正常执行了。
$ ~/bin/repo sync
-
下载单个项目的源码
$ cd ~
$mkdir android/android-source –p$cd android
$git clone https://android.googlesource.com/platform/frameworks/base.git android-sdk-source
-
获取各个版本SDK源码
$cd ~
$mkdir android/android-sdk-source –p
$cd android/android-sdk-source//显示所有的分支,包括远程和本地分支,我们没有建立分支,所有没有本地分支
$git branch –a
//显示所有标签$git tag
//检出源码
$git checkout (branch)/(tag)
其中core/java下即为sdk源码
-
Platform
Codename
API Level
Cupcake
3
Donut
4
Eclair
7
Froyo
8
Gingerbread
9
10
Honeycomb
11
12
13
Ice Cream Sandwich
14
15