12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/bash
- function wait_emulator_to_be_ready() {
- cpu_support_hardware_acceleration=$(grep -cw ".*\(vmx\|svm\).*" /proc/cpuinfo)
- kvm_support=$(kvm-ok)
- emulator_name=${EMULATOR_NAME_ARM}
- if [ "$cpu_support_hardware_acceleration" != 0 ] && [ "$kvm_support" != *"NOT"* ]; then
- emulator_name=${EMULATOR_NAME_x86}
- fi
- adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done
- # This command worked inside the original docker container:
- # emulator -avd android_arm -no-window -no-accel -timezone Europe/Paris -no-boot-anim -noaudio
- emulator -avd "${emulator_name}" -verbose -no-boot-anim -gpu swiftshader_indirect -timezone Europe/Paris -noaudio -no-accel -netspeed full -camera-back none -camera-front none -logcat "*:w" &
- boot_completed=false
- while [ "$boot_completed" == false ]; do
- status=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r')
- echo "Boot Status: $status"
- if [ "$status" == "1" ]; then
- boot_completed=true
- else
- sleep 1
- fi
- done
- }
- 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"
- }
- wait_emulator_to_be_ready
- sleep 1
- disable_animation
|