From 1c52f13e501e6749a5f0efb3ef3c59b3c832f309 Mon Sep 17 00:00:00 2001 From: Metin Kaya Date: Thu, 23 May 2024 18:13:00 +0100 Subject: [PATCH] tools/android: Clone install_android_platform_tools() from LISA Make sure devlib/install_base.sh has complete Android SDK support. This will be the first step of removing duplicate Android SDK installation functions from LISA/install_base.sh. Signed-off-by: Metin Kaya --- tools/android/install_base.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/android/install_base.sh b/tools/android/install_base.sh index 53db94d..5061475 100755 --- a/tools/android/install_base.sh +++ b/tools/android/install_base.sh @@ -66,6 +66,16 @@ get_android_sdk_host_arch() { echo "${arch}" } +# No need for the whole SDK for this one +install_android_platform_tools() { + echo "Installing Android Platform Tools ..." + + local url="https://dl.google.com/android/repository/platform-tools-latest-linux.zip" + + echo "Downloading Android Platform Tools from: ${url}" + wget -qO- "${url}" | bsdtar -xf- -C "${ANDROID_HOME}/" +} + cleanup_android_home() { echo "Cleaning up Android SDK: ${ANDROID_HOME}" rm -rf "${ANDROID_HOME}" @@ -238,6 +248,15 @@ for arg in "${args[@]}"; do handled=1 ;;& + # Not part of --install-all since that is already satisfied by + # --install-android-tools The advantage of that method is that it does not + # require the Java JDK/JRE to be installed, and is a bit quicker. However, + # it will not provide the build-tools which are needed by devlib. + "--install-android-platform-tools") + install_functions+=(install_android_platform_tools) + handled=1 + ;;& + "--install-android-tools" | "--install-all") install_functions+=( find_java_home