# How to build libs by your self. We use the following commit for demonstration ``` commit 62ee0c8110882c6153921c87e36774273fe0a75e (HEAD -> main, github/main) Author: Jian Chen Date: Wed Feb 22 19:42:36 2023 -0800 ``` The build commands are: ```bash #!/usr/bin/env bash export ANDROID_HOME=/Users/fangjun/software/my-android # ANDROID_HOME: Path to android sdk. # In this directory, you can find other directories like: # # emulator, platform-tools # export ANDROID_NDK_HOME=/Users/fangjun/software/my-android/ndk/22.1.7171670/ # ANDROID_NDK_HOME: Path to android NDK # In this directory, you can find the file: # build/cmake/android.toolchain.cmake num_jobs=3 # Get directory this script is in DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" abi=arm64-v8a # abi=armeabi-v7a # abi=x86_64 build_dir=$DIR/build/android-$abi #requires python3.6 or higher python3 \ $DIR/tools/ci_build/build.py \ --build_dir $build_dir \ --config Release \ --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF \ --cmake_extra_defines CMAKE_INSTALL_PREFIX=$build_dir/install/ \ --target install \ --parallel $num_jobs \ --skip_tests \ --build_shared_lib \ --android \ --android_abi $abi \ --android_api 21 ```