Script to set building environment variables ready for building library for Android
It will set bunch of necessary environment variables to be used in building a library project for Android platform.
This requires you already install NDK, and set $ANDROID_NDK_HOME
to your NDK version of choice.
There are the following configurable settings you can set
host_tag
- indicate host value that builds (default islinux-x86_64
)minsdkversion
- minimum sdk version to support, this is value of api level (default is 18)target_abi
- a single target abi value. it can bearmeabi-v7a
,x86
,arm64-v8a
, orx86_64
(default isarmeabi-v7a
)
The way to send in above parameters can be done with
. ./setandroidbuildenv minsdkversion=21 target_abi=arm64-v8a
or in case you've installed setandroidbuildenv
to your executable path i.e. /usr/local/bin
then you do the following instead
. setandroidbuildenv minsdkversion=21 target_abi=arm64-v8a
Note .
which is to source exported environment variables inside the script, so we can use it outside in active shell.
setandroidbuildenv --help
- to print help text. setandroidbuildenv --unset
- to unset all related and already set environment variables related in building operation (notice.
source at the beginning of the commandsetandroidbuildenv --print-active
- to print active environment variables' value. setandroidbuildenv <optional configurable settings>
- to set environment variables for building
MIT, Angry Baozi (https://abzi.co)