美文网首页
Android Repo

Android Repo

作者: hust_jsjs | 来源:发表于2015-11-01 16:08 被阅读0次

关于Android源码下载的问题,纠结了很久,遇到很多问题,现在终于解决了,小结一下。

1、Repo是什么?

    “repo只是google用Python脚本写的调用git的一个脚本,主要是用来下载、管理Android项目的软件仓库。(也就是说,他是用来管理给git管理的一个个仓库的)”引用来源

2、Repo获取

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

3、Repo初始化仓库

    国内采用清华镜像

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

4、同步代码

repo sync

下面说说遇到的问题

1、同步某个Project失败,手动同步了一下,查看输出日志

$ repo sync frameworks/compile/slang

Fetching project platform/frameworks/compile/slang

Fetching projects: 100% (1/1), done.

error: unable to create file tests/P_str_escape/str\\escape.rs (No such file or                                                                                                directory)

  奇葩的路径找不到,手动创建了该文件路径,同步就成功了。

$ repo sync frameworks/compile/slang

Fetching project platform/frameworks/compile/slang

Fetching projects: 100% (1/1), done.

2、经常遇到同步失败,网络错误,需要采用自动重试脚本

#!/bin/bash

echo ¨================start repo sync===============¨

repo sync -f -j4

while [ $? == 1 ]; do

echo ¨================sync failed, re-sync again=============¨

sleep 3

repo sync -f -j4

done

    这个脚本要命的是停止都停不下来,除非杀掉或成功。注意清华镜像要求不要使用-j参数,线程数目不能超过4(默认是4)

参考文章:

1、http://blog.csdn.net/sunchaoenter/article/details/46342759

2、http://mirrors.tuna.tsinghua.edu.cn/help/#AOSP

3、http://blog.csdn.net/luoshengyang/article/details/18195205

相关文章

  • repo命令入门

    https://source.android.com/setup/develop/repo 1 repo介绍 An...

  • Android Repo

    关于Android源码下载的问题,纠结了很久,遇到很多问题,现在终于解决了,小结一下。 1、Repo是什么? ...

  • Android源码分析——番外篇(一)

    repo学习 Android源码下载 Android内核源码下载 Android源码编译 Android内核源码编...

  • AOSP编译真机镜像

    源码准备 准备repo工具 Repo使用: http://source.android.com/source/us...

  • Repo使用

    Repo 是一款工具,可让您在 Android 环境中更轻松地使用 Git。 安装Repo 要安装 Repo,请执...

  • 2020-01-12 repo 下载 Android 镜像

    repo 下载 Android 镜像 下载repo网上给的repo大多是国外的网址,考虑到墙的存在,给不少同学增加...

  • Repo

    Repo是干什么的? 用来统一管理Android源代码的工具 Repo命令 核心形式:repo 列如: re...

  • Google Git-Repo (Android)多仓库项目管理

    原文:Google Git-Repo (Android)多仓库项目管理 前言 如果不是 Android dev 可...

  • Android:repo分析

    repo sync如何执行? Execute_Fetch_FetchProjectList应该是这个函数无疑了。会...

  • 私有仓库的jar 无法下载

    maven { url "http://repo.baichuan-android.taobao.com/cont...

网友评论

      本文标题:Android Repo

      本文链接:https://www.haomeiwen.com/subject/cozfhttx.html