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 代码好了。或者刚开始下载的时候,就下载你想要的版本。

最新文章

  1. JavaWeb前端:CSS
  2. ELF Format 笔记(三)—— Section Types
  3. sql server 2000通过机器名可以连,通过ip连不上的问题
  4. C语言实现二叉树-利用二叉树统计单词数目
  5. Unity 3D 一个简单的角色控制脚本
  6. 【转】解决编译Apache出现的问题:configure: error: APR not found . Please read the documentation
  7. HDU-4642 Fliping game 简单博弈
  8. ETL工具主流产品
  9. Java基础知识强化04:判断101~200之间有多少素数
  10. Android 修改host文件的3种方法
  11. Python学习笔记——基础篇【第六周】——shutil模块
  12. orderby与groupby区别
  13. Connecting Universities
  14. 如何在Cocos2D游戏中实现A*寻路算法(七)
  15. PSQLException: FATAL: no pg_hba.conf entry for host &quot;127.0.0.1&quot;, user &quot;ambari&quot;, database &quot;ambari&quot;, SSL off
  16. mysql 表结构及基本操作
  17. C#开发问题汇总
  18. 2019-04-18-day035-守护线程与池
  19. sin n次方 x 的降幂公式
  20. Web安全入门学习

热门文章

  1. 针对ie的css hack
  2. Race UVA - 12034(dp+打表)
  3. WinCE下的串口通信开发(VS2005,VB.Net,VC++)
  4. I/O复用——各种不同的IO模型
  5. Java中集合随笔
  6. window7及以上 创建软链接 mklink
  7. php auto_prepend_file和auto_append_file的妙用
  8. Python(一)数据结构和算法的20个练习题问答
  9. iOS:CALayer(17-12-06更)
  10. 『ACM C++』 Codeforces | 1003C - Intense Heat