【国内下载Android系统源码的方法】

一、准备工作:
1.安装VMware虚拟机;
2.安装ubuntu系统(到ubuntu官网下载最新版的就行,比如我下载的是22版本的,不要按教材上的下14.04的,太老了,bug多到让你抓狂);
二、在ubuntu内下载Adroid系统源码:
1.安装vm-tools:sudo apt-get install open-vm-tools-desktop
2.下载接下来要用到的工具:
sudo ln -s /usr/bin/python3 /usr/bin/python
apt install curl
apt install repo
apt install vim
apt install git
3.创建bin目录并准备下载:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
4.修改bashrc文件
vim ~/.bashrc
增加export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’
5.将repo内的google源替换成国内edu的
vim ~/bin/repo
替换
REPO_URL = ‘https://gerrit-google.tuna.tsinghua.edu.cn/git-repo’
6.创建source文件并做拉取初始化:
mkdir source
cd source
export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest(这个是默认拉取最新android版本的源码下来,如果你要指定版本,可以-b,然后接版本名;比如:repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-12.0.0_r9)
7.同步源码下来:
repo sync

然后等下完即可,很慢,要几个钟

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值