add: support all variables

This commit is contained in:
D
2024-04-23 18:02:44 +03:00
parent eccae59c47
commit d96d21781b
3 changed files with 37 additions and 24 deletions
+14 -13
View File
@@ -4,13 +4,13 @@ set -e
source ./emulator-monitoring.sh
# The emulator console port.
# The emulator console port.
EMULATOR_CONSOLE_PORT=5554
# The ADB port used to connect to ADB.
ADB_PORT=5555
MEMORY=16048
CORES=10
SKIP_AUTH=true
OPT_MEMORY=${MEMORY:-8192}
OPT_CORES=${CORES:-4}
OPT_SKIP_AUTH=${SKIP_AUTH:-true}
AUTH_FLAG=
# Start ADB server by listening on all interfaces.
echo "Starting the ADB server ..."
@@ -34,7 +34,7 @@ echo no | avdmanager create avd \
--package "$PACKAGE_PATH" \
--device "$DEVICE_ID"
if [ "$SKIP_AUTH" == "true" ]; then
if [ "$OPT_SKIP_AUTH" == "true" ]; then
AUTH_FLAG="-skip-adb-auth"
fi
@@ -55,17 +55,18 @@ fi
wait_for_boot &
# Start the emulator with no audio, no GUI, and no snapshots.
echo "Starting the emulator ... "
echo "OPTIONS: "
echo "GPU - $GPU_MODE"
echo "MEMORY - $MEMORY"
echo "CORES - $CORES"
echo "Starting the emulator ..."
echo "OPTIONS:"
echo "ADB AUTH - $OPT_SKIP_AUTH"
echo "GPU - $GPU_MODE"
echo "MEMORY - $OPT_MEMORY"
echo "CORES - $OPT_CORES"
emulator \
-avd android \
-gpu "$GPU_MODE" \
-memory $MEMORY \
-memory $OPT_MEMORY \
-no-boot-anim \
-cores $CORES \
-cores $OPT_CORES \
-ranchu \
$AUTH_FLAG \
-no-window \
@@ -73,4 +74,4 @@ emulator \
# -qemu \
# -smp 8,sockets=1,cores=4,threads=2,maxcpus=8
# -smp 8,sockets=1,cores=4,threads=2,maxcpus=8