Android源码环境切换版本

一、查看源码情况

1、查看当前版本

2、查看可切换的分支

cd .repo/manifests
git branch -a |cut -d / -f 3

部分输入如下:

......
android-9.0.0_r22
android-9.0.0_r3
android-9.0.0_r30
android-9.0.0_r31
android-9.0.0_r32
android-9.0.0_r33
android-9.0.0_r34
android-9.0.0_r35
android-9.0.0_r36
......

二、选择切换的版本

android-9.0.0_r3版本为例,执行以下命令:

repo init -b android-9.0.0_r3
# 本地是最新代码可以不用同步repo syncrepo start android-9.0.0_r3 --all
# 查看当前的分支   
repo branches

三、错误处理

错误一

error: in `start android-9.0.0_r3 --all`: [Errno 2] No such file or directory: 
u'/work/android/aosp/device/google/accessory/arduino/.git/HEAD'error: manifest missing or 
unreadable -- please run init

代码不是最新,输入repo sync解决

错误二

GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the
 possibility of losing the work tree's git metadata, use `repo sync --force-sync device/generic/mini-
 emulator-mips` to proceed.

同步失败,依次输入:

repo sync --force-sync device/generic/mini-emulator-mipsrepo sync

参考

问一个:android源代码,如何切换版本。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值