【AOSP专题】02. 谷歌Pixel 2XL+android8.1.0版本手机基于AOSP编译安卓系统

想要自己基于aosp编译安卓系统,本质上需要:

  • 确定好机型和版本

    你是什么手机?要在手机上编译什么版本的安卓系统?查找当前机型的驱动文件?
    
  • 系统初始化

    在ubuntu中安装必备的工具和命令,例如:同步源码需要的git
    
  • 同步aosp源码(下载代码)【耗时】

    基于repo进行代码的同步(底层本质调用git同步代码)
    
  • 安装依赖

    编译aosp源码需要安装jdk8、xsltproc、fontconfig等
    
  • 编译源码【耗时】

  • 安装至手机系统

1.机型和版本

本篇示例:Pixel2XL + android8.1.0

  • 官方包 https://developers.google.cn/android/images OPM2.171019.029

在这里插入图片描述

  • AOSP版 https://source.android.com/docs/setup/about/build-numbers OPM2.171019.029 android-8.1.0_r20
    在这里插入图片描述

  • Piexl 2XL驱动 https://developers.google.cn/android/drivers OPM2.171019.029
    在这里插入图片描述

2.系统初始化

  • Python软连接

    sudo ln -s /usr/bin/python3.6  /usr/bin/python
    
  • git

    sudo apt install git -y
    
    git config --global user.name "wupeiqi"
    git config --global user.email "wupeiqi@live.com"
    
  • curl

    sudo apt install curl -y
    
  • 其他(可选)

    sudo apt install net-tools openssh-server vim -y
    

3.同步源码

利用清华源去同步源码,国内主要是:清华源、中科大源(推荐清华)。

https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/

  • 下载repo + 环境变量 + 可执行权限

    mkdir ~/bin
    PATH=~/bin:$PATH
    curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
    chmod a+x ~/bin/repo
    
  • 环境变量

    export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
    
  • 创建aosp文件夹目录(以后放在代码)

    cd ~/bin
    mkdir aosp
    cd aosp
    
  • 指定同步版本

    repo init -u https://mirr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生而自由爱而无畏

你的打赏是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值