Ubutun 16.04下Android源码编译

    xiaoxiao2021-03-25  85

    ## 源码下载

    (一)配置下载环境

    $sudo apt-get install git-core

    配置git

    $ git config --global user.name "用户名" $ git config --global user.email "邮箱"

    安装curl

    $sudo apt-get install git-core curl

    创建bin目录

    $ mkdir ~/bin $ PATH=~/bin:$PATH

    下载repo

    $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo

    (二)初始化数据仓库 创建源码目录

    $mkdir ANDROID_SOURCES $cd ANDROID_SOURCES

    初始化

    buttps://android.googlesource.com/platform/manifest

    再初始化指定版本库

    $repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.2_r6

    同步源码仓

    $ repo sync

    整个源码大小根据版本而不同,越往后的版本源码越大整个就有60G左右,而且在不断更新,因此需要使用脚本去同步,防止断线

    #!/bin/bash echo ¨================start repo sync===============¨ repo sync -f -j4 while [ $? == 1 ]; do echo ¨================sync failed, re-sync again=============¨ sleep 3 repo sync -f -j4 done

    ## 构建编译环境

    ## 编译源码运行

    转载请注明原文地址: https://ju.6miu.com/read-36046.html

    最新回复(0)