Skip to content

Instantly share code, notes, and snippets.

@StelianMorariu
Created March 5, 2019 15:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StelianMorariu/45de2b1d4a85da6000d9afa490f5d6ba to your computer and use it in GitHub Desktop.
Save StelianMorariu/45de2b1d4a85da6000d9afa490f5d6ba to your computer and use it in GitHub Desktop.
Bitrise-Download specific NDK
#!/usr/bin/env bash
set -ex
# --------------------------------------------------------------
#
# ANDROID_NDK_VERSION and ANDROID_NDK_HOME are specified in
# -preflight but can also be updated directly in the script
#
# -------------------------------------------------------------
# set env vars
#export ANDROID_NDK_VERSION='r15c'
#export ANDROID_NDK_HOME='/opt/android-ndk'
# ------------------------------------------------------
# --- Android NDK
# clean up if a previous version is already installed
rm -rf "$ANDROID_NDK_HOME"
# download
mkdir /opt/android-ndk-tmp
cd /opt/android-ndk-tmp
wget -q https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
# uncompress
unzip -q android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
# move to its final location
mv ./android-ndk-${ANDROID_NDK_VERSION} ${ANDROID_NDK_HOME}
# remove temp dir
cd ${ANDROID_NDK_HOME}
rm -rf /opt/android-ndk-tmp
# add to PATH
#export PATH=${PATH}:${ANDROID_NDK_HOME}
# expose for subsequent steps
#envman add --key PATH --value "$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment