fix accel - add docker-compose - fix keys

This commit is contained in:
Alexandre Richonnier
2024-02-20 17:06:32 +00:00
parent 7a3b901e16
commit 92c5038d59
7 changed files with 319 additions and 57 deletions
+23
View File
@@ -13,6 +13,19 @@ function update_state() {
write_log "state-update" "$1"
}
function disable_animation() {
adb shell "settings put global window_animation_scale 0.0"
adb shell "settings put global transition_animation_scale 0.0"
adb shell "settings put global animator_duration_scale 0.0"
echo "...Disable animations"
};
function hidden_policy() {
adb shell "settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1"
echo "...Hidden policy"
};
# Waits for the emulator to boot and writes
# state updates on the standard output.
function wait_for_boot() {
@@ -30,5 +43,15 @@ function wait_for_boot() {
COMPLETED=$(adb shell getprop sys.boot_completed | tr -d '\r')
sleep 5
done
sleep 1
if [ "$DISABLE_ANIMATION" = "true" ]; then
disable_animation
sleep 1
fi
if [ "$DISABLE_HIDDEN_POLICY" = "true" ]; then
hidden_policy
sleep 1
fi
update_state "ANDROID_READY"
}
+22 -3
View File
@@ -8,7 +8,10 @@ source ./emulator-monitoring.sh
EMULATOR_CONSOLE_PORT=5554
# The ADB port used to connect to ADB.
ADB_PORT=5555
MEMORY=16048
CORES=10
SKIP_AUTH=true
AUTH_FLAG=
# Start ADB server by listening on all interfaces.
echo "Starting the ADB server ..."
adb -a -P 5037 server nodaemon &
@@ -31,6 +34,10 @@ echo no | avdmanager create avd \
--package "$PACKAGE_PATH" \
--device "$DEVICE_ID"
if [ "$SKIP_AUTH" == "true" ]; then
AUTH_FLAG="-skip-adb-auth"
fi
# If GPU acceleration is enabled, we create a virtual framebuffer
# to be used by the emulator when running with GPU acceleration.
# We also set the GPU mode to `host` to force the emulator to use
@@ -48,10 +55,22 @@ fi
wait_for_boot &
# Start the emulator with no audio, no GUI, and no snapshots.
echo "Starting the emulator ..."
echo "Starting the emulator ... "
echo "OPTIONS: "
echo "GPU - $GPU_MODE"
echo "MEMORY - $MEMORY"
echo "CORES - $CORES"
emulator \
-avd android \
-gpu "$GPU_MODE" \
-memory $MEMORY \
-no-boot-anim \
-cores $CORES \
-ranchu \
$AUTH_FLAG \
-no-window \
-no-snapshot || update_state "ANDROID_STOPPED"
-no-snapshot || update_state "ANDROID_STOPPED"
# -qemu \
# -smp 8,sockets=1,cores=4,threads=2,maxcpus=8