From 313532dcaabaa4c11854c47031d2a1de0c43bfa1 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 21 Jun 2024 02:45:48 -0700 Subject: [PATCH] Disable verbose output by default --- .github/workflows/build.yml | 3 +++ scripts/avd_test.sh | 27 ++++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e20770d..f67d0c9b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,6 +118,8 @@ jobs: sudo udevadm trigger --name-match=kvm - name: AVD test + env: + AVD_TEST_VERBOSE: 1 run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }} test-32: @@ -155,4 +157,5 @@ jobs: - name: AVD test env: FORCE_32_BIT: 1 + AVD_TEST_VERBOSE: 1 run: scripts/avd_test.sh ${{ matrix.version }} diff --git a/scripts/avd_test.sh b/scripts/avd_test.sh index 2a616e192..9d24f622c 100755 --- a/scripts/avd_test.sh +++ b/scripts/avd_test.sh @@ -3,7 +3,7 @@ emu="$ANDROID_SDK_ROOT/emulator/emulator" avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager" sdk="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" -emu_args_base='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot -show-kernel' +emu_args_base='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot' lsposed_url='https://github.com/LSPosed/LSPosed/releases/download/v1.9.2/LSPosed-v1.9.2-7024-zygisk-release.zip' boot_timeout=600 emu_pid= @@ -99,8 +99,15 @@ test_emu() { print_title "* Testing $pkg ($variant)" - "$emu" @test $emu_args & - emu_pid=$! + if [ -n "$AVD_TEST_VERBOSE" ]; then + "$emu" @test $emu_args & + emu_pid=$! + adb logcat & + else + "$emu" @test $emu_args 2>/dev/null & + emu_pid=$! + fi + wait_emu wait_for_boot adb shell 'PATH=$PATH:/debug_ramdisk magisk -v' @@ -118,6 +125,9 @@ test_emu() { fi adb reboot + if [ -n "$AVD_TEST_VERBOSE" ]; then + adb logcat & + fi wait_emu wait_for_boot # Run app tests @@ -177,17 +187,20 @@ run_test() { memory=8192 fi - local emu_args="$emu_args_base -memory $memory" + emu_args="$emu_args_base -memory $memory" + if [ -n "$AVD_TEST_VERBOSE" ]; then + emu_args="$emu_args -show-kernel" + fi # Setup emulator "$sdk" --channel=3 $pkg echo no | "$avd" create avd -f -n test -k $pkg + restore_backup $ramdisk + restore_backup $features # Launch stock emulator print_title "* Launching $pkg" - restore_backup $ramdisk - restore_backup $features - "$emu" @test $emu_args & + "$emu" @test $emu_args 2>/dev/null & emu_pid=$! wait_emu wait_for_bootanim