zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    JDBC的简单笔记
    javascript学习笔记二
    javascript学习一、js的初步了解
    css的简单学习笔记
    c++ 拷贝构造函数
    C++ new delete
    c++ 析构函数
    c++成员初始化和构造函数
    C++ 类和对象浅解
    c++ constexpr
  • 原文地址:https://www.cnblogs.com/flying_bat/p/13502831.html
Copyright © 2011-2022 走看看