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
|
|
|
|
SDKDIR=$PWD/.android-sdk
|
|
|
|
export ANDROID_HOME=${SDKDIR}
|
|
|
|
export ANDROID_SDK_ROOT=${SDKDIR}
|
|
|
|
fi
|
|
|
|
|
2022-07-20 19:27:08 +03:00
|
|
|
bash $PWD/utils/avd_stop.sh
|
2020-12-14 01:13:50 +03:00
|
|
|
|
|
|
|
echo "Starting emulator"
|
2023-08-26 05:30:09 +03:00
|
|
|
# nohup ${ANDROID_HOME}/emulator/emulator -avd android33 -gpu swiftshader &
|
2023-02-24 01:07:44 +03:00
|
|
|
nohup ${ANDROID_HOME}/emulator/emulator -avd android33 -no-audio -no-window -no-boot-anim -no-snapshot &
|
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
|
2022-08-02 19:22:27 +03:00
|
|
|
echo "Emulator started"
|
|
|
|
|
|
|
|
echo "Installing Chromium WebView"
|
2023-02-10 23:28:36 +03:00
|
|
|
# See here for the latest revision: https://storage.googleapis.com/chromium-browser-snapshots/Android/LAST_CHANGE
|
2023-08-31 19:08:27 +03:00
|
|
|
CHROMIUM_ANDROID_REVISION="1190572"
|
2022-08-02 19:22:27 +03:00
|
|
|
WEBVIEW_TMP_DIR="$(mktemp -d)"
|
|
|
|
WEBVIEW_TMP_FILE="$WEBVIEW_TMP_DIR/chrome-android-zip"
|
|
|
|
curl -s -o "${WEBVIEW_TMP_FILE}" "https://storage.googleapis.com/chromium-browser-snapshots/Android/${CHROMIUM_ANDROID_REVISION}/chrome-android.zip"
|
|
|
|
unzip -q "${WEBVIEW_TMP_FILE}" -d "${WEBVIEW_TMP_DIR}"
|
|
|
|
${ANDROID_HOME}/platform-tools/adb install -r "${WEBVIEW_TMP_DIR}/chrome-android/apks/SystemWebViewShell.apk"
|
|
|
|
rm -rf "${WEBVIEW_TMP_DIR}"
|
|
|
|
echo "Chromium WebView installed"
|