mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 10:37:05 +05:30
scripts: add boot_emulator
This commit is contained in:
parent
9a025f589a
commit
d8d43a4c88
1 changed files with 30 additions and 0 deletions
30
scripts/boot_emulator.sh
Executable file
30
scripts/boot_emulator.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Creates and boots an emulator that exactly matches the one in our CI. It is recommended
|
||||
# to use this as the target device for screenshot tests.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
[ -n "${ANDROID_SDK_ROOT:-}" ] || {
|
||||
echo "ANDROID_SDK_ROOT must be set to use this script"
|
||||
exit
|
||||
1
|
||||
}
|
||||
[ -n "${ANDROID_API_LEVEL:-}" ] || { echo "ANDROID_API_LEVEL not defined; defaulting to 30"; }
|
||||
|
||||
API_LEVEL="${ANDROID_API_LEVEL:-30}"
|
||||
|
||||
sdkmanager "system-images;android-${API_LEVEL};google_apis;x86_64"
|
||||
|
||||
echo no | "${ANDROID_SDK_ROOT}"/cmdline-tools/latest/bin/avdmanager create avd \
|
||||
--force \
|
||||
-n "Pixel_XL_API_${API_LEVEL}" \
|
||||
--abi 'google_apis/x86_64' \
|
||||
--package "system-images;android-${API_LEVEL};google_apis;x86_64" \
|
||||
--device 'pixel_xl'
|
||||
|
||||
"${ANDROID_SDK_ROOT}"/emulator/emulator \
|
||||
-avd "Pixel_XL_API_${API_LEVEL}" \
|
||||
-no-window \
|
||||
-noaudio \
|
||||
-no-boot-anim
|
Loading…
Add table
Add a link
Reference in a new issue