admin管理员组文章数量:1794759
AOSP源码下载
一、说明
由于一些原因,利用谷歌的资源下载Android源码速度很慢,我们可以用清华源里面的资源进行下载。 清华源AOSP配置下载地址详解:Android 镜像使用帮助
二、源码下载示例由于清华源中给出很清晰的配置下载方法,这儿只做几条总结:
1. 谷歌镜象不可用,采用清华源镜象 mirrors.tuna.tsinghua.edu/help/AOSP/ 2. 配置repo mkdir ~/bin PATH=~/bin:$PATH curl mirrors.tuna.tsinghua.edu/git/git-repo > ~/bin/repo chmod a+x ~/bin/repo注意:repo最好加到系统的环境变量中。
3. repo更新repo的运行过程中会尝试访问官方的git源更新自己,如果想使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc里
export REPO_URL='mirrors.tuna.tsinghua.edu/git/git-repo'并重启终端模拟器。
4. 下载初始化包 wget -c mirrors.tuna.tsinghua.edu/aosp-monthly/aosp-latest.tar 5. 解压资源包 tar xf aosp-latest.tar 6. 更新指定版本比如指定下载android-6.0.1_r62,执行以下命令:
repo init -u mirrors.tuna.tsinghua.edu/git/AOSP/platform/manifest -b android-6.0.1_r62 repo sync如果遇到"SyntaxError: invalid syntax"等错误,如下所示:
File "/home/jerry/workspace/aosp/.repo/repo/main.py", line 79 file=sys.stderr) ^ SyntaxError: invalid syntax应该是python语法导致的,解决方法如下:
python3 ~/bin/repo init -u mirrors.tuna.tsinghua.edu/git/AOSP/platform/manifest -b android-6.0.1_r62 python3 ~/bin/repo sync 7. 快捷脚本由于网络及限制网络并发等原因,repo sync常常更新失败,可以用脚本来更新,脚本示例:
repo sync -j4 while [ $? = 1 ]; do echo "==== sync failed, re-sync again ====" sleep 3 repo sync -j4 done 三、注意 1. 遇到同步失败的问题比如OMA-DM这个app同步失败,我们可以修改AOSP目录下的.repo/manifests/default.xml来屏蔽掉这个应用的同步,如下图:
2. 遇到python语法问题参照如下语法根据实际情况执行repo命令,注意repo要写上绝对路径,否则会报错。
python3 ~/bin/repo init -u mirrors.tuna.tsinghua.edu/git/AOSP/platform/manifest -b android-6.0.1_r62 python3 ~/bin/repo sync版权声明:本文标题:AOSP源码下载 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686525518a77741.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论