How to use ART to compile x86 oat files on the host
- source build/envsetup.sh
- mm build-art
- Use the following script in the root of the source directory:
######
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
export ANDROID_ROOT="${CWD}/out/host/linux-x86"
BOOT_IMAGE="${CWD}/out/host/linux-x86/framework/core.art"
OUTPUT="${CWD}/out/oatfiles/x86"
mkdir -p $OUTPUT
mkdir -p $ANDROID_DATA
out/host/linux-x86/bin/dex2oat --runtime-arg -classpath --runtime-arg $1 --instruction-set=x86 --runtime-arg -Xrelocate --host --boot-image=$BOOT_IMAGE --dex-file=$1 --oat-file=$OUTPUT/$1.oat
######
How to use ART to compile ARM oat files on the host
- mm build-art
- Build the full android image for aosp_arm-eng
- Use the following script in the root of the source directory:
######
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
export ANDROID_ROOT="${CWD}/out/host/linux-x86"
BOOT_IMAGE="${CWD}/out/target/product/generic/system/framework/boot.art"
OUTPUT="${CWD}/out/oatfiles/arm"
mkdir -p $OUTPUT
mkdir -p $ANDROID_DATA
out/host/linux-x86/bin/dex2oat --runtime-arg -classpath --runtime-arg $1 --instruction-set=arm --runtime-arg -Xrelocate --host --boot-image=$BOOT_IMAGE --dex-file=$1 --oat-file=$OUTPUT/$1.oat
######