2023-02-15 13:55:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2023-02-15 03:01:51 +00:00
|
|
|
# If the installation flag of the Android SDK is set
|
|
|
|
|
# we download the Android command-line tools,
|
|
|
|
|
# install the SDK, platform tools and the emulator.
|
|
|
|
|
if [ "$INSTALL_ANDROID_SDK" == "1" ]; then
|
|
|
|
|
echo "Installing the Android SDK, platform tools and emulator ..."
|
|
|
|
|
wget https://dl.google.com/android/repository/commandlinetools-linux-${CMD_LINE_VERSION}.zip -P /tmp && \
|
|
|
|
|
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools/ && \
|
|
|
|
|
unzip -d $ANDROID_SDK_ROOT/cmdline-tools/ /tmp/commandlinetools-linux-${CMD_LINE_VERSION}.zip && \
|
|
|
|
|
mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools/ $ANDROID_SDK_ROOT/cmdline-tools/tools/ && \
|
|
|
|
|
rm /tmp/commandlinetools-linux-${CMD_LINE_VERSION}.zip && \
|
|
|
|
|
yes | sdkmanager --licenses && \
|
2023-02-16 16:01:48 +00:00
|
|
|
sdkmanager --install "$PACKAGE_PATH" "$ANDROID_PLATFORM_VERSION" platform-tools emulator
|
2023-02-15 03:01:51 +00:00
|
|
|
fi
|