23 lines
702 B
Bash
Executable File
23 lines
702 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Make sure we are running this script as root.
|
|
[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1
|
|
|
|
ANDROID_CLI_TOOLS_FILE=commandlinetools-linux-7583922_latest.zip
|
|
ANDROID_CLI_TOOLS_LINK=https://dl.google.com/android/repository/${ANDROID_CLI_TOOLS_FILE}
|
|
ANDROID_CLI_TOOLS_DIR=cmdline-tools
|
|
ANDROID_SDK_DIR=/opt/android_sdk
|
|
|
|
wget $ANDROID_CLI_TOOLS_LINK
|
|
unzip $ANDROID_CLI_TOOLS_FILE
|
|
rm $ANDROID_CLI_TOOLS_FILE
|
|
mkdir $ANDROID_SDK_DIR
|
|
mv $ANDROID_CLI_TOOLS_DIR /opt/android_sdk/
|
|
|
|
${ANDROID_SDK_DIR}/bin/sdkmanager --sdk_root=${ANDROID_SDK_DIR} --install \
|
|
"platforms;android-21" \
|
|
"sources;android-21" \
|
|
"platform-tools" \
|
|
"build-tools;21.1.2" \
|
|
"ndk;21.4.7075529"
|