2020-11-11 01:47:26 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-12-14 01:13:50 +03:00
|
|
|
set -e
|
|
|
|
|
2020-11-11 01:47:26 +03:00
|
|
|
SDKDIR=$PWD/.android-sdk
|
|
|
|
export ANDROID_SDK_ROOT=${SDKDIR}
|
|
|
|
export ANDROID_HOME=${SDKDIR}
|
|
|
|
export ANDROID_AVD_HOME=${SDKDIR}/avd
|
|
|
|
|
|
|
|
mkdir ${SDKDIR}
|
|
|
|
mkdir ${SDKDIR}/cmdline-tools
|
|
|
|
|
|
|
|
echo Downloading Android SDK...
|
|
|
|
cd ${SDKDIR}/cmdline-tools
|
2020-12-14 01:13:50 +03:00
|
|
|
COMMAND_LINE_TOOLS_ZIP=${SDKDIR}/commandlinetools.zip
|
2021-08-16 08:54:30 +03:00
|
|
|
curl https://dl.google.com/android/repository/commandlinetools-mac-7583922_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP}
|
2020-12-14 01:13:50 +03:00
|
|
|
unzip ${COMMAND_LINE_TOOLS_ZIP}
|
|
|
|
rm ${COMMAND_LINE_TOOLS_ZIP}
|
2020-11-11 01:47:26 +03:00
|
|
|
mv cmdline-tools latest
|
2020-12-14 01:13:50 +03:00
|
|
|
ln -s ${SDKDIR}/cmdline-tools/latest ${SDKDIR}/tools
|
2020-11-11 01:47:26 +03:00
|
|
|
|
|
|
|
echo Installing emulator...
|
2020-12-14 01:13:50 +03:00
|
|
|
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install platform-tools emulator
|
2020-11-11 01:47:26 +03:00
|
|
|
|
|
|
|
echo Installing platform SDK...
|
2021-08-16 18:13:02 +03:00
|
|
|
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install "platforms;android-31"
|
2020-11-11 01:47:26 +03:00
|
|
|
|
|
|
|
echo Starting ADB...
|
2020-12-14 01:13:50 +03:00
|
|
|
${ANDROID_HOME}/platform-tools/adb devices
|