• Ubuntu 20.04编译Android 8.1


    一、配置环境

    sudo apt install git-core gnupg flex bison gperf build-essential 
          zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 
          lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev 
          libncurses5 libxml2-utils python xsltproc unzip
    

    二、配置环境变量.bash_profile

    # Compiler cache
    export USE_CCACHE=1
    export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
    export PATH=~/Documents/android/bin:$PATH
    export ANDROID_JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
    export PATH=$ANDROID_JAVA_HOME/bin:$PATH
    export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
    

    四、下载AOSP源代码
    • 下载repo并设置权限

    mkdir ~/Documents/android/bin
    curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/Documents/android/bin/repo
    chmod a+x ~/Documents/android/bin/repo
    

    • 初始化仓库

    cd ~/Documents/android_8.1
    repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-8.1.0_r62
    repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-8.1.0_r62
    repo sync -c
    

    五、编译AOSP源代码

    cd ~/Documents/android_8.1
    # Set ccache
    prebuilts/misc/linux-x86/ccache/ccache -M 50G 
    # Clean out directory
    make clobber 
    # Jack server configuration
    export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx6g"
    ./prebuilts/sdk/tools/jack-admin kill-server
    ./prebuilts/sdk/tools/jack-admin start-server 
    # Setup environment 
    source build/envsetup.sh
    
    # Select device target
    lunch
    # Build sources (cofee time)
    make -j8
    

    六、编译单项

    source build/envsetup.sh
    cd external/tinyxml
    mm
    
  • 相关阅读:
    Git学习笔记
    利用GitHub Pages和Hexo搭建个人博客
    dpkg的用法
    Ubuntu 16.04安装有道词典
    Linux 命令之删除命令
    Linux 命令之权限修改
    PHP学习记录第一篇:Ubuntu14.04下LAMP环境的搭建
    ubuntu时钟不显示的解决方法
    kali linux 2.0安装sublime text 2
    折腾kali linux2.0
  • 原文地址:https://www.cnblogs.com/flying_bat/p/13502831.html
Copyright © 2020-2023  润新知