1
1
mirror of https://github.com/microsoft/playwright.git synced 2024-12-15 14:11:50 +03:00
playwright/utils/avd_install.sh
2021-08-16 08:13:02 -07:00

30 lines
842 B
Bash
Executable File

#!/bin/bash
set -e
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
COMMAND_LINE_TOOLS_ZIP=${SDKDIR}/commandlinetools.zip
curl https://dl.google.com/android/repository/commandlinetools-mac-7583922_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
echo Installing platform SDK...
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install "platforms;android-31"
echo Starting ADB...
${ANDROID_HOME}/platform-tools/adb devices