Windows下载Android源代码
下载msysgit,安装
官方下载:http://code.google.com/p/msysgit/downloads/list,
打开Git Bash,运行命令
cd D: git clone https://android.googlesource.com/platform/manifest.git

输入命令,切换到manifest文件夹
cd manifest
git tag 列出android各个分支版本号
git tag
下载android-2.2系统源代码,输入以下命令,假设要下载其它版本号源代码,checkout git tag列出的版本号号就可以
git checkout android-2.2_r1
checkout之后,manifest/default.xml文件里记录的就是android2.2系统各个模块的路径
我们来分析一下default.xml文件,
以bionic为例,path属性表示bionic源代码的相对路径,如果android源代码在d:/android-source,下载bionic之后,应该存放在d:/android-source/bionic文件夹
name属性是bionic源代码在库上的路径,完整的路径就是:http://android.googlesource.com/platform/bionic.git,有了源代码下载路径,运行git clone就能够将bionic源代码下载到本地
<project path="bionic" name="platform/bionic" />
Android源代码中project非常多,一个一个下载比較麻烦,本人写了一个python脚本,双击download-src.py运行此脚本,就能够将android完整源代码下载到本地。
PS:运行此脚本的前提是已经运行了git checkout,选择好了要下载的Android源代码版本号,假设你的manifest文件不是D:/manifest/default.xml,请自行改动脚本。
download-src.py源代码:
import xml.dom.minidom
import os
from subprocess import call #downloaded source path
rootdir = "D:/android-source" #git program path
git = "D:/Program Files/Git/bin/git.exe" dom = xml.dom.minidom.parse("D:/manifest/default.xml")
root = dom.documentElement prefix = git + " clone https://android.googlesource.com/"
suffix = ".git" if not os.path.exists(rootdir):
os.mkdir(rootdir) for node in root.getElementsByTagName("project"):
os.chdir(rootdir)
d = node.getAttribute("path")
last = d.rfind("/")
if last != -1:
d = rootdir + "/" + d[:last]
if not os.path.exists(d):
os.makedirs(d)
os.chdir(d)
cmd = prefix + node.getAttribute("name") + suffix
call(cmd)
Windows下载Android源代码的更多相关文章
- windows平台下载android源代码
最近观看<android核心分析>,所以很多细节都没有详细看代码很难理解.请记住,印象不深.感觉是最好再一起去的源代码,返回下载android源代码,遇到了许多问题,最后开始下载.合并流程 ...
- (国内)完美下载android源代码(文章已经丢失)
刚刚文章莫名其妙的丢了,我重写了一篇,http://blog.csdn.net/song19891121/article/details/50099857 我们在很多时候需要下载android源代码进 ...
- 在Mac OS X中下载Android源代码的一些经验
首先说明.随着最近(2014年6月開始)GFW的升级.这个站点:http://www.android.com/ 已经不能正常訪问了,以下的这些操作均是在我连接VPN的时候进行的. 首先,须要做一些准备 ...
- 转:Windows下载Android源码
原文来自于:http://blog.csdn.net/hlf48641715/article/details/7188450 下载msysgit,安装 官方下载:http://code.google. ...
- Mac下命令行下载android源代码并构建apk过程
前提是java .sdk.ndk .cmake.gradle .gradlew都已经安装和配置好. 1.下载源码: git clone http://git-ma.xxxx.com.cn/xxxx/x ...
- 下载Android源代码编译错误总结
错误1: prebuilts/sdk/api/18.txt:22055: error 9: Removed public method android.telephony.gsm.SmsMessage ...
- 1、android源代码下载与跟踪
学习Android源代码的目的 理解Android API查找API(Activity.Content Provider等) 高级应用开发(ROM定制) 在不同平台下载Android源代码 W ...
- Android源代码下载方法具体解释
作者:张星 相信非常多下载过内核的人都对这个非常熟悉 git clone git://android.git.kernel.org/kernel/common.git kernel 可是这是在曾经,如 ...
- Eclipse Android源代码新下载方法及关联
一.下载Android源代码 Android源代码从4.0后就可以使用SDK Manager进行下载,打开SDK Manager就可以看到,已4.4为例: 关联Android源代码 但是老是提示下载失 ...
随机推荐
- spring aop expression简单说明
<aop:config> <aop:pointcut id="userDAO" expression="execution(public * cn.da ...
- Google服务背后的天文数字
每天当我们在互联网上驰骋的时候,在背后支撑网页.应用.服务运转的就是各种编程语言和代码.无论是Gmail确认收件箱还是执行关键词搜索都需要大量的代码,但是你知道Google的各项互联网服务合起来需要多 ...
- delete drop truncate
一.相同点 1 truncate.不带where子句的delete.drop都会删除表内的数据2 drop.truncate都是DDL语句(数据定义语言),执行后会自动提交 二.不同点 1trunca ...
- IOS UIView(UIButton)通过显示动画移动的时候 响应点击的解决方案
今天在做一个UIButton显示动画的时候,遇到一个问题,就是在移动的时候 ,需要相应它的点击时间(click) 通过CAKeyframeAnimation 来移动UIButton的layer ,效果 ...
- 软件测试技术(二)——使用等价类划分的方法进行的UI测试
测试的目标程序 程序代码 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; impo ...
- Ye.云狐J2刷机笔记 | 完美切换内部存储卡和SD卡的改法.vold.fstab
================================================================================Ye.完美切换内部存储卡和SD卡成功.v ...
- CSAPP(2):程序的汇编表示(Linux版)
程序员学习汇编代码的需求随着时间的推移发生了变化,开始时只要求程序员能直接用汇编语言编写程序,现在则要求他们能够阅读和理解编译器产生的代码. 下面是针对32位机器 数据格式 Intel用术语“字”(w ...
- 《Linux命令行与shell脚本编程大全》 第三章 学习笔记
第三章:基本的bash shell命令 bash程序使用命令行参数来修改所启动shell的类型 参数 描述 -c string 从string中读取命令并处理他们 -r 启动限制性shell,限制用户 ...
- window.parent 判断是否是被嵌入iframe里面
项目中有个这样逻辑:B页面嵌套A页面 如图下: 但是B页面有可能独立出来.所以判断B页面是否被嵌入进去则使用 window.parent==window 如果是true B页面是独立的,false B ...
- HDU 1702 队列与栈的简单运用http://acm.hdu.edu.cn/showproblem.php?pid=1702
#include<stdio.h> #include<string.h> #include<queue> #include<stack> #define ...