天天看點

Windows下擷取Android系統源碼

接手android也有一年的時間了,由于剛開始學習時資料比較少,又大多都是斷章取義的,是以對于android我一直處于似懂非懂的狀态下。今天終于感覺到該留點學習的經驗吧,那就從這篇開始我的android系列文章了。

Android使用Git管理源代碼的,在Linux下我們可以使用ubuntu來擷取系統源碼,下面我就逐漸介紹在Windows些如何擷取Android系統源碼了。

一。安裝msysGit

在google的http://code.google.com/p/msysgit/中這樣介紹到:

If you just want to use Git to do your version control in Windows, you will need to download Git for Windows, run the installer, and you are ready to start. Note: Git for Windows is a project run by volunteers, so if you want it to improve, volunteer!

If you want to download and install the complete source code of Git for Windows (including C compiler) to start hacking, you will need to install the full development system which is called msysGit.

注釋:如果你需要使用Git工具在Windows下進行版本控制,你可以使用基于Windows的Git,這裡提供了msysGit的安裝下載下傳。

我們選擇full安裝版本,http://code.google.com/p/msysgit/downloads/detail?name=msysGit-fullinstall-1.7.3.1-preview20101002.exe。

下載下傳msysGit安裝包後安裝,在安裝過程中msysGit會自動的安裝或編譯基于Windows環境的Git。編譯Git需要點時間,安裝完後截圖如下:

Windows下擷取Android系統源碼

這就是Git的shell視窗,你可以在其中通過命名行操作下載下傳得到Android的系統源碼,下面就以Lunacher——桌面——為例下載下傳源碼。

二。下載下傳Luancher源碼

Android系統源碼都在http://android.git.kernel.org/網址下,其中那個系統app都在platform/packages/apps結構下。

在剛才的Git的shell命名行視窗中輸入下面的命名:

git clone git://android.git.kernel.org/platform/packages/apps/Luancher2.git

你就可以在你的msysGit安裝目錄的git下(~\msysgit\msysgit\git)看到Luancher工程檔案夾了。

Windows下擷取Android系統源碼
Windows下擷取Android系統源碼

然後打開~\msysgit\msysgit\git\Luancher2檔案夾,就可以看到Android的Luancher系統源碼工程了。

Windows下擷取Android系統源碼

對于其他的app系統源碼的擷取方法和上述的Luancher相同,隻是命名行後的參數不同。

git clone git://android.git.kernel.org/需下載下傳源碼的app所在的位置。

三。啟動msysGit

有些朋友在關閉了msysGit命名行視窗後就找不到重新打開的連結了,不用着急,你隻需要在你安裝的msysGit路徑下輕按兩下執行msys.bat檔案即可。

所有的都大功告成了。

轉載于:https://www.cnblogs.com/Youhei/archive/2011/01/09/Android_msysGit.html

繼續閱讀