ubuntu编译Android需要几分钟,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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值