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
|
|
|
|
2020-12-14 01:13:50 +03:00
|
|
|
if [[ -z "${ANDROID_HOME}" ]]; then
|
|
|
|
SDKDIR=$PWD/.android-sdk
|
|
|
|
export ANDROID_HOME=${SDKDIR}
|
|
|
|
export ANDROID_SDK_ROOT=${SDKDIR}
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Killing previous emulators"
|
2020-12-15 05:39:14 +03:00
|
|
|
${ANDROID_HOME}/platform-tools/adb devices | grep emulator | cut -f1 | while read line; do ${ANDROID_HOME}/platform-tools/adb -s $line emu kill; done
|
2020-12-14 01:13:50 +03:00
|
|
|
|
2022-02-24 08:57:32 +03:00
|
|
|
EMULATOR_GPU="host"
|
|
|
|
if [[ -n "${GITHUB_ACTIONS}" ]]; then
|
|
|
|
EMULATOR_GPU="swiftshader_indirect"
|
|
|
|
fi
|
|
|
|
|
2020-12-14 01:13:50 +03:00
|
|
|
echo "Starting emulator"
|
2022-02-24 08:57:32 +03:00
|
|
|
nohup ${ANDROID_HOME}/emulator/emulator -avd android32 -no-audio -no-window -gpu ${EMULATOR_GPU} -no-boot-anim &
|
2020-12-14 01:13:50 +03:00
|
|
|
${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
|
|
|
|
${ANDROID_HOME}/platform-tools/adb devices
|
|
|
|
echo "Emulator started"
|