From c985fea383e5a77473d089b5dee4fd1c27de3d85 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 13 Mar 2020 13:02:25 +0300 Subject: [PATCH] Add check for sdk manager installation --- images/linux/scripts/installers/1604/android.sh | 13 ++++++++++++- images/linux/scripts/installers/1804/android.sh | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index c9b4d9d2e..8f1321146 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -22,8 +22,19 @@ wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip +# Check sdk manager installation +${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +if [ $? -eq 0 ] +then + echo "Android SDK manager was installed" +else + echo "Android SDK manager was not installed" + exit 1 +fi + + # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \ diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index c415080db..098e9c3ca 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -22,8 +22,18 @@ wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip +# Check sdk manager installation +${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +if [ $? -eq 0 ] +then + echo "Android SDK manager was installed" +else + echo "Android SDK manager was not installed" + exit 1 +fi + # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \