Skip to content

Instantly share code, notes, and snippets.

@Themaister
Last active October 2, 2018 08:07
Show Gist options
  • Save Themaister/0fe665c6715906f30acb201c3fd5eb0d to your computer and use it in GitHub Desktop.
Save Themaister/0fe665c6715906f30acb201c3fd5eb0d to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z $ANDROID_HOME ]; then
ANDROID_HOME="$HOME/Android/Sdk"
fi
echo "=== Installing SDK and NDK to $ANDROID_HOME. If this is not desired, override ANDROID_HOME environment variable! ==="
mkdir -p "$ANDROID_HOME"
cd "$ANDROID_HOME"
echo "=== Downloading SDK Tools for Linux ==="
TOOLS_VERSION=4333796
wget https://dl.google.com/android/repository/sdk-tools-linux-$TOOLS_VERSION.zip
unzip sdk-tools-linux-$TOOLS_VERSION.zip
yes | ./tools/bin/sdkmanager --licenses
./tools/bin/sdkmanager --install ndk-bundle
./tools/bin/sdkmanager --install platform-tools
echo "=== Installed Android SDK and NDK. Make sure to set ANDROID_HOME environment variable to \"$ANDROID_HOME\"! ==="
echo "=== Other SDK components like Android platforms and CMake will be automatically installed later by Gradle when you invoke Gradle. ==="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment