Last active
April 30, 2021 02:10
-
-
Save barelyhuman/dd9e176e0ad770698efb272a83572107 to your computer and use it in GitHub Desktop.
Setup Android tools for CLI , assumes jdk was already installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SDK_VERSION=commandlinetools-linux-6609375_latest.zip | |
ANDROID_BUILD_VERSION=30 | |
ANDROID_TOOLS_VERSION=30.0.3 | |
NDK_VERSION=20.1.5948944 | |
# set default environment variables | |
ANDROID_HOME=$HOME/android | |
ANDROID_SDK_HOME=${ANDROID_HOME} | |
ANDROID_NDK=${ANDROID_HOME}/ndk/$NDK_VERSION | |
JAVA_HOME=/usr/lib/jvm/java-8-openjdk | |
PATH=${ANDROID_NDK}:${ANDROID_HOME}/cmdline-tools/tools/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:/opt/buck/bin/:${PATH} | |
curl -sS https://dl.google.com/android/repository/${SDK_VERSION} -o /tmp/sdk.zip \ | |
&& mkdir -p ${ANDROID_HOME}/cmdline-tools \ | |
&& unzip -q -d ${ANDROID_HOME}/cmdline-tools /tmp/sdk.zip \ | |
&& rm /tmp/sdk.zip \ | |
&& yes | sdkmanager --licenses \ | |
&& yes | sdkmanager "platform-tools" \ | |
"emulator" \ | |
"platforms;android-$ANDROID_BUILD_VERSION" \ | |
"build-tools;$ANDROID_TOOLS_VERSION" \ | |
"cmake;3.10.2.4988404" \ | |
"system-images;android-21;google_apis;armeabi-v7a" \ | |
"ndk;$NDK_VERSION" \ | |
&& rm -rf ${ANDROID_HOME}/.android | |
echo "export PATH=$PATH" >> ~/.zshrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.bashrc
for bash and.zshrc
for zsh