Skip to content

Commit c7e14c6

Browse files
committed
Fix github action
1 parent 2a6f827 commit c7e14c6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/android-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
./sdkmanager "emulator"
3333
./sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
3434
./sdkmanager "platforms;android-${TARGET_VERSION}"
35-
./sdkmanager "system-images;android-30;google_apis;x86"
35+
./sdkmanager "system-images;android-30;google_apis;x86_64"
3636
37-
- name: Enable KVM
37+
- name: Enable KVM (safe for CI even if no hardware accel)
3838
run: |
3939
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
4040
sudo udevadm control --reload-rules
@@ -43,7 +43,7 @@ jobs:
4343
- name: Create AVD
4444
run: |
4545
cd $ANDROID_HOME/cmdline-tools/latest/bin
46-
echo no | ./avdmanager create avd -n test -k "system-images;android-30;google_apis;x86" --force
46+
echo no | ./avdmanager create avd -n test -k "system-images;android-30;google_apis;x86_64" --force
4747
4848
- name: Start ADB Server
4949
run: adb start-server
@@ -52,23 +52,19 @@ jobs:
5252
run: |
5353
echo "Starting emulator..."
5454
export PATH=$PATH:$ANDROID_HOME/emulator
55-
nohup emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics > /dev/null 2>&1 &
56-
57-
# Wait for ADB to detect the device
55+
nohup emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics -accel off > /tmp/emulator.log 2>&1 &
56+
5857
echo "Waiting for emulator device..."
5958
adb wait-for-device
6059
61-
# Poll for full boot
62-
boot_completed=""
6360
echo "Waiting for emulator to boot..."
61+
boot_completed=""
6462
until [[ "$boot_completed" == "1" ]]; do
6563
sleep 5
6664
boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
6765
done
6866
69-
# Optional: unlock the screen (some test frameworks expect an unlocked device)
7067
adb shell input keyevent 82
71-
7268
echo "Emulator is fully booted."
7369
7470
- name: Verify emulator is running
@@ -81,3 +77,7 @@ jobs:
8177
8278
- name: Run tests
8379
run: ./gradlew clean connectedCheck --stacktrace
80+
81+
- name: Dump emulator log on failure
82+
if: failure()
83+
run: cat /tmp/emulator.log

0 commit comments

Comments
 (0)