Files
docker-android2/scripts/install-sdk.sh
T
2023-02-15 03:01:51 +00:00

15 lines
854 B
Bash

# 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 && \
sdkmanager --install "$PACKAGE_PATH" && \
yes | sdkmanager --verbose $PACKAGE_PATH $ANDROID_PLATFORM_VERSION platform-tools emulator
fi