Android - install dependencies to build android projects on linux/ci/other using sdkmanager/android terminal tools
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
mkdir /opt/android-sdk
mv tools_r25.2.3-linux.zip /opt/android-sdk
cd /opt/android-sdk
unzip -u tools_r25.2.3-linux.zip
Put in .bashrc
file (root path: /root/.bashrc
)
export ANDROID_HOME="/opt/android-sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH:"
#!/usr/bin/env bash
#
# Install required dependencies
# sdkmanager can be found in $ANDROID_HOME/tools/bin/sdkmanager
#
for I in "platforms;android-25" \
"build-tools;25.0.3 " \
"extras;google;m2repository" \
"extras;android;m2repository" \
"extras;google;google_play_services"; do
echo "Trying to update with tools/bin/sdkmanager: " $I
echo y | sdkmanager $I
done
sdkmanager --update
#!/usr/bin/env bash
#
# Install required dependencies with android command
#
for DEP in android-25 \
build-tools-25.0.2 \
tool \
extra-android-m2repository \
extra-android-support \
extra-google-google_play_services \
extra-google-m2repository;
do echo y | android update sdk --no-ui --all --filter $DEP ; done