aosp 怎么切换分支?

To properly switch Android version, all you need to change is branch for your manifest repository. First determine the available branches with manifests for the different Android versions:

cd $ANDROID_ROOT
cd .repo/manifests
git branch -av # see all available branches on origin
Select a version and cd $ANDROID_ROOT
repo init -b <my_selected_android_version>
Such selective repo init with -b (without -u) will only update manifest branch and will not otherwise touch your tree. Now, simply sync it: repo sync -j8
and some time later, your Android tree will switch to another version. Speed of this operation is mostly determined by how much default.xml manifest file differs between old and new Android versions - because if some git repository was added in new manifest, it will spend time cloning it. And if some repository was removed, if will actually blow it away. But, by and large, this method is still much faster than initializing brand new Android tree from scratch.

https://stackoverflow.com/questions/14008113/how-to-switch-android-version-in-local-repo

caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/manifests$ python repo init -b android-8.0.0_r9

遇到错误:

  File "/usr/lib/aosp_dir/aosp/.repo/repo/project.py", line 2858, in runner
(self._project.name, name, p.stderr))
error.GitError: manifests var:
*** Please tell me who you are.

执行以下命令:

  git config --global user.email "you@example.com"
git config --global user.name "Your Name"

fatal: unable to auto-detect email address (got ‘caoxinyu@caoxinyu-ThinkPad-T470p.(none)’)

caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/repo$ git config --global user.email "caoxinyu"
caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/repo$ git config --global user.email "coaxinyu@gmail.com"
caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/repo$ git config --global user.name "caoxinyu"

每次都会提示下面这些,不用管。

caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/repo$ python repo init -b android-8.0.0_r9
warning: redirecting to https://aosp.tuna.tsinghua.edu.cn/platform/manifest/ Your identity is: caoxinyu <coaxinyu@gmail.com>
If you want to change this, please re-run 'repo init' with --config-name repo has been initialized in /usr/lib/aosp_dir/aosp
If this is not the directory in which you want to initialize repo, please run:
rm -r /usr/lib/aosp_dir/aosp/.repo
and try again.
caoxinyu@caoxinyu-ThinkPad-T470p:/usr/lib/aosp_dir/aosp/.repo/repo$ python repo sync -j8

python repo sync -f
Syncing work tree: 52% (296/568)error: in `sync -f`: revision refs/tags/android-8.0.0_r9 in platform/external/valgrind not found syncing work tree: 86% (489/568)error: in `sync -f -j10`: revision refs/tags/android-8.0.0_r36 in platform/prebuilts/clang/host/darwin-x86 not found
system/bt/embdrv/Android.bp": not found

总结:

不建议这样弄。我尝试了几次,都以失败告终。还是研究最新的android 代码好了。或者刚开始下载的时候,就下载你想要的版本。

(AOSP)repo checkout指定版本的更多相关文章

  1. [Git]checkout 指定版本

    Task:知道commit号,如何checkout 指定版本 1. 切换到master: git checkout master 2. 下载最新代码:  git pull 3. 下载head: git ...

  2. 在Linux Centos 7.2 上安装指定版本Docker。

    相关资料链接: https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce 先清空下“历史” yum remov ...

  3. 在Linux Centos 7.2 上安装指定版本Docker 17.03

    相关资料链接: https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce 先清空下“历史” yum insta ...

  4. 使用清华大学开源软件镜像AOSP的“每月更新初始化包”更新指定版本的Android源码

    参照官方教程:Tsinghua Open Source Mirror 1. 下载了repo工具 mkdir  ~/bin PATH = ~/bin:$PATH curl  https://storag ...

  5. [git] 更新到某个指定版本

    [git] 更新到某个指定版本 - Vanquisher - 博客频道 - CSDN.NET     [git] 更新到某个指定版本    2015-09-06 09:30 527人阅读 评论(0) ...

  6. 在 Git 中 Checkout 历史版本

    昨天写代码的时候,误删了一个文件.今天发现的时候,commit 已经 push 到版本库了.本想用 git reset 回退版本,找回文件后重新提交.但是想起 Git 是一个版本控制系统哎,直接从版本 ...

  7. Linux下yum安装MySQL yum安装MySQL指定版本

    yum安装MySQL 1. 查看有没有安装过     yum list installed MySQL* (有存在要卸载yum remove MySQL*)     rpm -qa | grep my ...

  8. brew 安装指定版本命令行工具 tmux 多版本实现

    Homebrew 是 macOS 命令安装工具,其核心库里的命令行在 github homebrew-core 仓库上维护. 核心库命令大概有 5000 条左右,大部分的命令行工具只保留了最新版本的 ...

  9. 安装指定版本的docker服务

    参考博客:Docker CE 镜像源站 参考博客:docker启动异常driver not supported 1. 说明 之前部署docker服务的时候都是安装最新的docker版本,并使用dock ...

随机推荐

  1. hdu-2620 Ice Rain---数论(取模运算规律)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2620 题目大意: 给出n和k求: 解题思路: kmodi=k-i*[k/i] ,所以=nk-(1*[ ...

  2. BZOJ1879:[SDOI2009]Bill的挑战(状压DP)

    Description Input 本题包含多组数据.  第一行:一个整数T,表示数据的个数.  对于每组数据:  第一行:两个整数,N和K(含义如题目表述).  接下来N行:每行一个字符串. T ≤ ...

  3. Mac--查看公钥

    打开macbook的终端输入以下命令: $ cd ~/.ssh $ ls $ cat id_rsa.pub

  4. python -- @classmethod @staticmethod区别和使用

    python中的定义: class MyClass: ... @classmethod  # classmethod的修饰符 def class_method(cls, arg1, arg2, ... ...

  5. 【数据结构】浅谈倍增求LCA

    思路 运用树上倍增法可以高效率地求出两点x,y的公共祖先LCA 我们设f[x][k]表示x的2k辈祖先 f[x][0]为x的父节点 因为从x向根节点走2k 可以看成从x走2k-1步 再走2k-1步 所 ...

  6. 我想写一个前端开发工具(三):优化!从vue-cli学了几招

    我从过年开始写自己的前端工具 coodev,目前已经写出一个基本的架子,大多数预想的功能都能跑通,还剩一些需要解决的问题也都已经列出来了.本来这一周打算解决对不同后端模板的前后端渲染支持的问题.但是看 ...

  7. Number & Math

    Java Number & Math 类 一般地,当需要使用数字的时候,我们通常使用内置数据类型,如:byte.int.long.double 等. 实例 int a = 5000; floa ...

  8. 确保img的宽高比固定

    html: <div class="wrapper"> <swiper :options="swiperOption"> <swi ...

  9. Notes 20180308 : 语句

    在讲解流程控制语句之前,我们先来说一下语句的问题.Java中的语句分为声明和赋值语句,条件和循环语句,调用和返回语句:我们之所以每两个放在一起是有深意的,我们大致将语句分为这三块,并以此为纲来说一下, ...

  10. UICollectionView的水平流水布局自定义layout

    最近做合创共美的商城项目,遇到发货地址的不配送地区,是做一个弹出框,弹出框的布局是根据地名字数长短不齐的标签. 本来也可以用tableview来做的.只不过多建几个tableviewcell就可以了. ...