- 安裝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