[转载]Windows下获取Android系统源码

[转载]Windows下获取Android系统源码 – 杨平 – youhei – 博客园.

接手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需要点时间,安装完后截图如下:

12

这就是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工程文件夹了。

3456

然后打开~\msysgit\msysgit\git\Luancher2文件夹,就可以看到Android的Luancher系统源码工程了。

78

对于其他的app系统源码的获取方法和上述的Luancher相同,只是命名行后的参数不同。

git clone git://android.git.kernel.org/需下载源码的app所在的位置。

三。启动msysGit

有些朋友在关闭了msysGit命名行窗口后就找不到重新打开的链接了,不用着急,你只需要在你安装的msysGit路径下双击执行msys.bat文件即可。

所有的都大功告成了。

赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏