下载Android源代码

对于AOSP来说下载Android源代码当然可以按照官方说明来操作,但是实际网络环境的原因从Google站点拉源代码可能会失败。

这里介绍环境受限时拉Android15源代码.

1.下载repo工具

bash 复制代码
$curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$chmod a+x ~/bin/repo
$export PATH=~/bin:$PATH

2.配置repo环境

bash 复制代码
#~/.bashrc中添加如下内容
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

repo运行过程中会尝试访问官方的git源来更新自己,可以通过REPO_URL环境变量指定国内镜像源,如下是repo脚本截取:

3.初始化仓库

bash 复制代码
$mkdir ~/code/Android15
$cd ~/code/Android15
$repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/mirror/manifest -b android-15.0.0_r1

4.同步源码树

bash 复制代码
$repo sync -j16
相关推荐
booboosui1 天前
Android 上来电怎么判:7 个条件加 5 个中文词
android
MardaWang1 天前
App 内嵌 H5 的信任边界设计(ArkWeb/HarmonyOS 实战)
android
石头慢慢说1 天前
不写 XPath,让 AI 在真机上跑测试:Appium MCP 全流程实战
android
90后的晨仔1 天前
解决 Android 构建报错:Unable to delete file .../file-map.txt
android·前端
mg6681 天前
安卓玩机工具----安卓手机变成桌面电脑!多窗口镜像+音频投射+游戏操控,无需 Root
android·智能手机·电脑
peakmain91 天前
异常处理 - Native 层的崩溃捕获机制及实现 (一)
android·性能优化
木头左2 天前
【Android】听写播放器改版:中英文书写速度拆项与「正在读」高亮
android·room·media3·jetpack compose·听写
好的佩奇2 天前
Dart 之方法、操作符与可调用对象
android·flutter·dart
恋猫de小郭2 天前
Flutter Impeller Vulkan 内存持续上涨,问题没想到是文字阴影
android·前端·flutter