logo
0
0
Login

AOSP 项目说明

构建步骤

  1. 解压 tar (耗时3~4分钟)
tar -xvf aosp.tar
  1. 检出代码(这里只做本地检出,耗时1~2分钟)
cd aosp repo sync --local -j$(nproc --all)
  1. 编译 (全量编译耗时1h20m左右)
source build/envsetup.sh lunch sdk_tablet_x86_64-trunk_staging-userdebug make -j$(nproc --all)

构建步骤-使用脚本

. checkout.sh . build.sh # 或者一起运行 . checkout.sh && . build.sh

打包模拟器镜像

make emu_img_zip

同步最新代码

如果你想检出并同步最新代码,在检出代码时不指定 --local 即可,不想同步的话尽可能的指定参数和增减并发线程,这样会快一些。同步大概会下载 5~7GB 数据,大概需要10来分钟(以带宽100Mbit/s)计算

# 添加安全目录 git config --global --add safe.directory /workspace/aosp/.repo/repo # 尽量减少并发,清华tuna源会限制并发,AOSP官方也会。-c 仅同步当前分支 repo sync -c -j8

构建时长

全新构建大概1小时30分钟,这个要看编译的类型,比如我这里编译的是sdk_tablet_x86_64-trunk_staging-userdebug,这个类型是平板。如果编译的是lunch aosp_cf_x86_64_phone-trunk_staging-userdebug,编译时间会长一些(有些依赖没处理好或容器编译的问题,试过编译两次超3小时而且是 失败)。

About

AOSP 源代码包 源下载地址为 https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/

Language
Markdown46.5%
Dockerfile41.9%
Shell10.1%
gitignore1.6%