2023-07-03 16:27:06 +03:00
|
|
|
#!/usr/bin/env bash
|
2020-11-11 01:47:26 +03:00
|
|
|
|
2020-12-14 01:13:50 +03:00
|
|
|
set -e
|
2020-11-11 01:47:26 +03:00
|
|
|
|
2020-12-14 01:13:50 +03:00
|
|
|
if [[ -z "${ANDROID_HOME}" ]]; then
|
2024-02-05 22:39:00 +03:00
|
|
|
export ANDROID_HOME="$PWD/.android-sdk"
|
2020-12-14 01:13:50 +03:00
|
|
|
fi
|
|
|
|
|
2022-12-15 09:56:57 +03:00
|
|
|
ANDROID_ARCH="x86_64"
|
|
|
|
|
|
|
|
# on MacOS M1 we need to use arm64 (can't emulate x86_64)
|
|
|
|
if [[ "$(uname -m)" == "arm64" ]]; then
|
|
|
|
ANDROID_ARCH="arm64-v8a"
|
|
|
|
fi
|
|
|
|
|
2024-02-05 22:39:00 +03:00
|
|
|
${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"
|
2020-12-14 01:13:50 +03:00
|
|
|
${ANDROID_HOME}/emulator/emulator -list-avds
|