目录
10.1 repo: error: "git" failed with exit status 128
10.2 fatal: cannot create directory at 'pathtools/testdata/escapes/**': Invalid argument
参考:
理解 Android Build 系统 # https://developer.ibm.com/zh/articles/os-cn-android-build/
理解Android编译命令 # http://gityuan.com/2016/03/19/android-build/
[安卓文档]Android 开发设置 # https://source.android.com/setup
[安卓文档]搭建编译环境 # https://source.android.com/source/initializing.html
[安卓文档]下载源代码 # https://source.android.com/source/downloading
[安卓文档]编译 Android # https://source.android.com/setup/build/building
[安卓文档]开发 # https://source.android.com/source/developing
使用Android Studio调试Android Framework代码 # https://blog.csdn.net/industriously/article/details/50548474
用Android Studio 导入整个android 源码,调试系统代码 # https://blog.csdn.net/aaa111/article/details/43227367
1. 安装 Repo
Repo 是一款工具,可让您在 Android 环境中更轻松地使用 Git。要安装 Repo,请执行以下操作:
1.1 确保主目录下有一个 bin/ 目录,并且该目录包含在路径中:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
1.2 下载 Repo 工具,并修改执行权限确保它可执行(注:国内访问第一步网址可能需要那个,可用链接: https://pan.baidu.com/s/1bpLwXCb 密码: hjsp (下载放到~/bin底下)):
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
1.3 (按需配置)使用您的真实姓名和电子邮件地址配置 Git。要使用 Gerrit 代码审核工具,您需要一个与已注册的 Google 帐号关联的电子邮件地址。确保这是您可以接收邮件的有效地址。您在此处提供的姓名将显示在您提交的代码的提供方信息中。
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
要详细了解 Repo,可参阅:
[需那个]开发 # https://source.android.com/source/developing
[需那个]Repo 命令参考资料 # https://source.android.com/source/using-repo.html
2. 下载Android源码
2.1 寻找 repo init
指令
从官网或者各种私有库中获取到安卓系统源码的repo地址,在此之前,您可能需要使用 Gerret 并获取相应 Gerret 仓库的访问权限。(重要,但略)
比如Android源码的 rope init 指令Gerret仓库地址为:
repo init -u https://android.googlesource.com/platform/manifest (Master分支)
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 ( -b 指令指定分支,要查看分支列表,请参阅源代码标记和版本</