您的位置:首页 > 移动开发 > Android开发

android版本下载以及切换

2012-08-28 22:45 204 查看
1:下载android主线分支

repo init -u https://android.googlesource.com/platform/manifest



2:下载android其它分支

repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1



3;查看android分支版本号

git --git-dir .repo/manifests/.git/ branch -a



4:查看android当前版本号

在build/core/version_defaults.mk文件中查看PLATFORM_VERSION即可。



5:切换android分支

4.1 初始化repo客户端到某一分支(以android-4.0.3_r1为例)

repo init -b android-4.0.3_r1

可以在目录 .repo/manifest.xml中查看repo客户端是在哪个分支上。

4.1 同步代码

repo sync

6:创建自己的本地分支

6.1 构造本地分支

repo start myandroid4.0.3 --all ,分支名称为myandroid4.0.3

6.2检出到自己创建的分支上

repo checkout myandroid4.0.3 或

repo checkout myandroid4.0.3 origin/android-4.0.3_r1

7:下载android linux kernel代码

查看https://android.googlesource.com/

8:如何获得指定版本的Linux内核
在下载目录下执行:
git checkout remotes/origin/android-2.6.29
(以android-2.6.29为例)
9:查看repo可切换的分支

cd .repo/manifests

git branch -a | cut -d / -f 3

出错问题解决:
1:执行repo sync时出现
fatal: '../platform/abi/cpp.git' does not appear to be a git repository

fatal: The remote end hung up unexpectedly

error: Cannot fetch platform/abi/cpp
------》在.repo目录下的manifest.xml里找到fetch属性,改成fetch= "git://Android.git.linaro.org/ ",或
"http://android.googlesource.com”。
:


repo工具是git工具的封装,下载单个project时使用git,下载所有android源码时使用repo工具。用法都是一样的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: