From ff0dafa3f309da9168cdfcfb3b653f1be917201d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Tue, 30 Jan 2024 18:23:04 +0100 Subject: [PATCH] ci: install intel-haxm only on macOS, run emulator with --accel-check --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4548555..c4a54df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -324,10 +324,13 @@ jobs: run: | pushd mobile/src/main/jniLibs && ls -R && popd + - name: Install intel-haxm + if: runner.os == "macOS" + run: brew install intel-haxm + # # # Below code is majorly from https://github.com/actions/runner-images/issues/6152#issuecomment-1243718140 - name: Create Android emulator run: | - brew install intel-haxm # Install AVD files echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses @@ -366,6 +369,7 @@ jobs: run: | echo "Starting emulator and waiting for boot to complete...." ls -la $ANDROID_HOME/emulator + $ANDROID_HOME/tools/emulator --accel-check # check for hardware acceleration nohup $ANDROID_HOME/tools/emulator -avd $MATRIX_AVD -gpu host -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 & $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do echo "wait..."; sleep 1; done; input keyevent 82' echo "Emulator has finished booting"