Disable verbose output by default

This commit is contained in:
topjohnwu 2024-06-21 02:45:48 -07:00
parent 2f8f3dc266
commit 313532dcaa
2 changed files with 23 additions and 7 deletions

View File

@ -118,6 +118,8 @@ jobs:
sudo udevadm trigger --name-match=kvm sudo udevadm trigger --name-match=kvm
- name: AVD test - name: AVD test
env:
AVD_TEST_VERBOSE: 1
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }} run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
test-32: test-32:
@ -155,4 +157,5 @@ jobs:
- name: AVD test - name: AVD test
env: env:
FORCE_32_BIT: 1 FORCE_32_BIT: 1
AVD_TEST_VERBOSE: 1
run: scripts/avd_test.sh ${{ matrix.version }} run: scripts/avd_test.sh ${{ matrix.version }}

View File

@ -3,7 +3,7 @@
emu="$ANDROID_SDK_ROOT/emulator/emulator" emu="$ANDROID_SDK_ROOT/emulator/emulator"
avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager" avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager"
sdk="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" 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' lsposed_url='https://github.com/LSPosed/LSPosed/releases/download/v1.9.2/LSPosed-v1.9.2-7024-zygisk-release.zip'
boot_timeout=600 boot_timeout=600
emu_pid= emu_pid=
@ -99,8 +99,15 @@ test_emu() {
print_title "* Testing $pkg ($variant)" print_title "* Testing $pkg ($variant)"
if [ -n "$AVD_TEST_VERBOSE" ]; then
"$emu" @test $emu_args & "$emu" @test $emu_args &
emu_pid=$! emu_pid=$!
adb logcat &
else
"$emu" @test $emu_args 2>/dev/null &
emu_pid=$!
fi
wait_emu wait_for_boot wait_emu wait_for_boot
adb shell 'PATH=$PATH:/debug_ramdisk magisk -v' adb shell 'PATH=$PATH:/debug_ramdisk magisk -v'
@ -118,6 +125,9 @@ test_emu() {
fi fi
adb reboot adb reboot
if [ -n "$AVD_TEST_VERBOSE" ]; then
adb logcat &
fi
wait_emu wait_for_boot wait_emu wait_for_boot
# Run app tests # Run app tests
@ -177,17 +187,20 @@ run_test() {
memory=8192 memory=8192
fi 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 # Setup emulator
"$sdk" --channel=3 $pkg "$sdk" --channel=3 $pkg
echo no | "$avd" create avd -f -n test -k $pkg echo no | "$avd" create avd -f -n test -k $pkg
restore_backup $ramdisk
restore_backup $features
# Launch stock emulator # Launch stock emulator
print_title "* Launching $pkg" print_title "* Launching $pkg"
restore_backup $ramdisk "$emu" @test $emu_args 2>/dev/null &
restore_backup $features
"$emu" @test $emu_args &
emu_pid=$! emu_pid=$!
wait_emu wait_for_bootanim wait_emu wait_for_bootanim