This commit is contained in:
Max Schmitt 2024-02-05 20:39:00 +01:00 коммит произвёл GitHub
Родитель bf31f2865f
Коммит 2690e4c827
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 20 добавлений и 26 удалений

Просмотреть файл

@ -2,29 +2,29 @@
set -e
SDKDIR=$PWD/.android-sdk
export ANDROID_SDK_ROOT=${SDKDIR}
export ANDROID_HOME=${SDKDIR}
export ANDROID_AVD_HOME=${SDKDIR}/avd
if [[ -n "${ANDROID_HOME}" ]]; then
echo "ANDROID_HOME is already set. This script is only for a local installation of the Android SDK."
exit 1
fi
mkdir ${SDKDIR}
mkdir ${SDKDIR}/cmdline-tools
export ANDROID_HOME="$PWD/.android-sdk"
mkdir -p ${ANDROID_HOME}/cmdline-tools
echo Downloading Android SDK...
cd ${SDKDIR}/cmdline-tools
COMMAND_LINE_TOOLS_ZIP=${SDKDIR}/commandlinetools.zip
# https://developer.android.com/studio#command-tools
curl https://dl.google.com/android/repository/commandlinetools-mac-8512546_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP}
unzip ${COMMAND_LINE_TOOLS_ZIP}
cd ${ANDROID_HOME}/cmdline-tools
COMMAND_LINE_TOOLS_ZIP=${ANDROID_HOME}/commandlinetools.zip
# https://developer.android.com/studio
curl https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP}
unzip ${COMMAND_LINE_TOOLS_ZIP}
rm ${COMMAND_LINE_TOOLS_ZIP}
mv cmdline-tools latest
ln -s ${SDKDIR}/cmdline-tools/latest ${SDKDIR}/tools
echo Installing emulator...
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install platform-tools emulator
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install platform-tools emulator
echo Installing platform SDK...
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install "platforms;android-33"
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-33"
echo Starting ADB...
${ANDROID_HOME}/platform-tools/adb devices

Просмотреть файл

@ -3,9 +3,7 @@
set -e
if [[ -z "${ANDROID_HOME}" ]]; then
export SDKDIR=$PWD/.android-sdk
export ANDROID_HOME=${SDKDIR}
export ANDROID_SDK_ROOT=${SDKDIR}
export ANDROID_HOME="$PWD/.android-sdk"
fi
ANDROID_ARCH="x86_64"
@ -15,7 +13,7 @@ if [[ "$(uname -m)" == "arm64" ]]; then
ANDROID_ARCH="arm64-v8a"
fi
${ANDROID_HOME}/tools/bin/avdmanager delete avd --name android33 || true
echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install "system-images;android-33;google_apis;$ANDROID_ARCH"
echo "no" | ${ANDROID_HOME}/tools/bin/avdmanager create avd --force --name android33 --device "Nexus 5X" --package "system-images;android-33;google_apis;$ANDROID_ARCH"
${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager delete avd --name android33 || true
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-33;google_apis;$ANDROID_ARCH" platform-tools emulator
echo "no" | ${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager create avd --force --name android33 --device "Nexus 5X" --package "system-images;android-33;google_apis;$ANDROID_ARCH"
${ANDROID_HOME}/emulator/emulator -list-avds

Просмотреть файл

@ -3,9 +3,7 @@
set -e
if [[ -z "${ANDROID_HOME}" ]]; then
SDKDIR=$PWD/.android-sdk
export ANDROID_HOME=${SDKDIR}
export ANDROID_SDK_ROOT=${SDKDIR}
export ANDROID_HOME="$PWD/.android-sdk"
fi
bash $PWD/utils/avd_stop.sh

Просмотреть файл

@ -3,9 +3,7 @@
set -e
if [[ -z "${ANDROID_HOME}" ]]; then
SDKDIR=$PWD/.android-sdk
export ANDROID_HOME=${SDKDIR}
export ANDROID_SDK_ROOT=${SDKDIR}
export ANDROID_HOME="$PWD/.android-sdk"
fi
echo "Killing previous emulators"