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
+10 -3
View File
@@ -142,15 +142,22 @@ docker build \
``` ```
### Variables ### Variables
## Default variables
#### Disable animation #### Disable animation
DISABLE_ANIMATION=false DISABLE_ANIMATION=false
#### Disable hidden policy #### Disable hidden policy
DISABLE_HIDDEN_POLICY=true DISABLE_HIDDEN_POLICY=false
#### skip adb authentication #### Skip adb authentication
SKIP_AUTH=false SKIP_AUTH=true
#### Memory for emulator
MEMORY=8192
#### Cores for emulator
CORES=4
### Mount an external drive in the container ### Mount an external drive in the container
+6 -1
View File
@@ -15,6 +15,8 @@ services:
- DISABLE_HIDDEN_POLICY=true - DISABLE_HIDDEN_POLICY=true
- SKIP_AUTH=false - SKIP_AUTH=false
#- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal #- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal
- MEMORY=16384
- CORES=16
privileged: true privileged: true
tty: true tty: true
stdin_open: true stdin_open: true
@@ -40,6 +42,8 @@ services:
- DISABLE_HIDDEN_POLICY=true - DISABLE_HIDDEN_POLICY=true
- SKIP_AUTH=false - SKIP_AUTH=false
#- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal #- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal
- MEMORY=16384
- CORES=16
privileged: true privileged: true
tty: true tty: true
stdin_open: true stdin_open: true
@@ -72,6 +76,8 @@ services:
- DISABLE_HIDDEN_POLICY=true - DISABLE_HIDDEN_POLICY=true
- SKIP_AUTH=false - SKIP_AUTH=false
#- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal #- ANDROID_ADB_SERVER_ADDRESS=host.docker.internal
- MEMORY=16384
- CORES=16
privileged: true privileged: true
tty: true tty: true
stdin_open: true stdin_open: true
@@ -89,4 +95,3 @@ services:
- driver: nvidia - driver: nvidia
count: 1 count: 1
capabilities: [gpu] capabilities: [gpu]
+12 -11
View File
@@ -8,9 +8,9 @@ source ./emulator-monitoring.sh
EMULATOR_CONSOLE_PORT=5554 EMULATOR_CONSOLE_PORT=5554
# The ADB port used to connect to ADB. # The ADB port used to connect to ADB.
ADB_PORT=5555 ADB_PORT=5555
MEMORY=16048 OPT_MEMORY=${MEMORY:-8192}
CORES=10 OPT_CORES=${CORES:-4}
SKIP_AUTH=true OPT_SKIP_AUTH=${SKIP_AUTH:-true}
AUTH_FLAG= AUTH_FLAG=
# Start ADB server by listening on all interfaces. # Start ADB server by listening on all interfaces.
echo "Starting the ADB server ..." echo "Starting the ADB server ..."
@@ -34,7 +34,7 @@ echo no | avdmanager create avd \
--package "$PACKAGE_PATH" \ --package "$PACKAGE_PATH" \
--device "$DEVICE_ID" --device "$DEVICE_ID"
if [ "$SKIP_AUTH" == "true" ]; then if [ "$OPT_SKIP_AUTH" == "true" ]; then
AUTH_FLAG="-skip-adb-auth" AUTH_FLAG="-skip-adb-auth"
fi fi
@@ -55,17 +55,18 @@ fi
wait_for_boot & wait_for_boot &
# Start the emulator with no audio, no GUI, and no snapshots. # Start the emulator with no audio, no GUI, and no snapshots.
echo "Starting the emulator ... " echo "Starting the emulator ..."
echo "OPTIONS: " echo "OPTIONS:"
echo "GPU - $GPU_MODE" echo "ADB AUTH - $OPT_SKIP_AUTH"
echo "MEMORY - $MEMORY" echo "GPU - $GPU_MODE"
echo "CORES - $CORES" echo "MEMORY - $OPT_MEMORY"
echo "CORES - $OPT_CORES"
emulator \ emulator \
-avd android \ -avd android \
-gpu "$GPU_MODE" \ -gpu "$GPU_MODE" \
-memory $MEMORY \ -memory $OPT_MEMORY \
-no-boot-anim \ -no-boot-anim \
-cores $CORES \ -cores $OPT_CORES \
-ranchu \ -ranchu \
$AUTH_FLAG \ $AUTH_FLAG \
-no-window \ -no-window \