前言

Linux 环境:

  • 安装Ubuntu(或VM虚拟机安装)
  • win10开启内置Ubuntu

现在WIN10内置Ubuntu方便使用

AOSP

AOSP(Android Open Source Project)是Google开放的Android 开源项目,中文官网为:https://source.android.google.cn/
国内获取AOSP源镜像源:清华大学镜像站、中科大镜像

AOSP Google 官方教程下载 https://source.android.com/source/downloading.html
网站直接查看代码:

  • http://androidxref.com/
  • 也可访问 https://cs.android.com 或 https://github.com/aosp-mirror 在线搜索及浏览 AOSP 源码。
  • AOSPXRef

AOSP | 镜像站使用帮助 | 清华大学开源软件镜像站

按照“镜像站使用帮助”说明就可以了

需要注意:
1、Ubuntu更换国内源
#先备份原来的源列表文件
mv /etc/apt/sources.list /etc/apt/sourses.list.backup
#新建源列表文件
vim /etc/apt/sources.list

#加入源地址(推荐用阿里云源)

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

#更新软件列表
sudo apt-get update
#更新软件(把已安装的软件与刚刷新的软件列表中的版本进行对比,如果发现已安装的软件版本太低,就会提示更新)
sudo apt-get upgrade

2、下载 git、repo工具

sudo apt-get install git
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

3、配置gitconfig
git config --global user.email xhbruce@foxmail.com
git config --global user.name xhbruce

xuhun@Bruce-xu:/mnt/d/AOSP/android-10.0.0_r36/frameworks/base$ git config --global --list
core.filemode=false
core.autocrlf=true
user.email=xbruce@foxmail.com
user.name=xbruce

4、可下载android-10.0.0_r36

repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-10.0.0_r36

5、替换已有的 AOSP 源代码的 remote
如果你之前已经通过某种途径获得了 AOSP 的源码(或者你只是 init 这一步完成后), 你希望以后通过 TUNA 同步 AOSP 部分的代码,只需要将 .repo/manifest.xml 把其中的 aosp 这个 remote 的 fetch 从 https://android.googlesource.com 改为 https://mirrors.tuna.tsinghua.edu.cn/git/AOSP。

<manifest><remote  name="aosp"
-           fetch="https://android.googlesource.com"
+           fetch="https://mirrors.tuna.tsinghua.edu.cn/git/AOSP"review="android-review.googlesource.com" /><remote  name="github"

同时,修改 .repo/manifests.git/config,将

url = https://android.googlesource.com/platform/manifest

更改为

url = https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

推荐使用单仓下载

对绝大多数人查看Android源码不会涉及全部代码,一般需要platform/frameworks/base 和 platform/frameworks/native

初始化仓库:

repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

下载单仓platform/frameworks/base 和 platform/frameworks/native:

repo sync platform/frameworks/base
repo sync platform/frameworks/native

参看对应分支

git branch -a
git branch -a |grep android11-

切换到对应分支,如remotes/aosp/android11-release
git checkout -b android11-release remotes/aosp/android11-release

AOSP : Android源码下载相关推荐

  1. 《深入理解Android内核设计思想(第2版)(上下册)》之Android源码下载及编译

    本文摘自人民邮电出版社异步社区<深入理解Android内核设计思想(第2版)(上下册)> 购书地址:http://item.jd.com/12212640.html 试读地址:http:/ ...

  2. Android源码下载教程

    文章目录 导语 国内源码资料 一.环境准备 1. Linux环境 2. JDK环境 3. 安装GIT工具 4. 安装依赖 二.安装Repo工具 三.初始化仓库 1. 创建文件夹 2. 初始化Repo ...

  3. Android源码下载(官方版)

    2019独角兽企业重金招聘Python工程师标准>>> 下载Android源码 Android的源代码位于由谷歌托管的Git仓库. 安装Repo Repo是一款使android源码下 ...

  4. 《深入理解Android内核设计思想(第2版)(上下册)》之Android源码下载及编译...

    本文摘自人民邮电出版社异步社区<深入理解Android内核设计思想(第2版)(上下册)> 购书地址:item.jd.com/12212640.ht- 试读地址:www.epubit.com ...

  5. 【Android】Android源码下载

    学而不思则罔,思而不学则殆 [Android]Android源码下载 一.环境准备 虚拟机 Ubuntu系统 二.Android源码下载 Ubuntu下载 1.repo下载 2.修改源代码镜像地址 3 ...

  6. AOSP安卓源码下载

    Android源码下载 在国内想下载Android要么科学上网,要么使用国内搭建的镜像,有清华镜像,中科大的镜像网站.这里使用清华镜像网站镜像Android源码的下载清华镜像网站地址,为啥我要写这篇笔 ...

  7. android源码下载以及编译自己的ROM

    android源码下载以及编译自己的ROM 最近发现kernel.org被墙了,为什么这种网站也能被墙了? 要想下载源码的话,只能绕过去了.下面是我从网上搜索到的一些下载方法: =========== ...

  8. android源码下载方法 批量下载 基于windows os

    安装win版的Gitbash, 在这里 http://msysgit.googlecode.com/files/Git-1.6.0.2-preview20080923.exe. 选择默认安装路径(否则 ...

  9. I.MX6 android 源码下载

    /************************************************************************** I.MX6 android 源码下载* 说明:* ...

最新文章

  1. 钉钉、支付宝合种树,2-4天领证,限量9个名额
  2. 目标检测--Object Detection via Aspect Ratio and Context Aware
  3. [Java基础]字符流读写数据的方式
  4. ssm使用全注解实现增删改查案例——Dept
  5. 国行 lg g3 D858 刷 lg g3 D858hk 教程(备忘)
  6. P2341 [HAOI2006]受欢迎的牛 强连通
  7. 浪潮服务器5112面板灯_SA5112M4 – IPMI设置
  8. 红橙Darren视频笔记 反射注解泛型简介
  9. 如何让一个div里面的div垂直居中?
  10. 枚举进程ID并且获得进程路径
  11. 车牌识别及验证码识别的一般思路
  12. iOS提交TestFlight测试显示缺少合规证明
  13. 函数__内置函数(reversed,slice,format,ord,chr,ascii,repr)递归,迭代,二分法
  14. 网页实现黑客帝国代码雨
  15. Ubuntu18.04安装PX4并与ROS联合实验
  16. 史玉柱自述创业历程,我思故我在
  17. 因果卷积(causal)与扩展卷积(dilated)
  18. php调用翻译,PHP调用有道词典翻译API实现翻译功能及代码
  19. Kali常见攻击手段
  20. python实现clahe对比度增强

热门文章

  1. 利用python爬取网页选考要求数据
  2. 2023年全国最新安全员精选真题及答案34
  3. 2019程序seo排名_SEO趋势可帮助您在2019年排名更高
  4. leetcode第297——二叉树的序列化与反序列化(层次遍历)
  5. 初探人工神经网络算法
  6. int 和 Integer 有什么区别,Integer的值缓存范围
  7. Android中获取软键盘状态和软键盘高度
  8. 抖音怎么看热门作品 手机视频md5修改工具下载
  9. DBA日记:上海的RAC宕机
  10. 人教新课标 小学一年级语文上册教学视频