@@ -343,6 +343,30 @@ jobs:
343343 adb kill-server || echo "Failed to kill adb server"
344344 echo "=== Cleanup complete ==="
345345
346+ - name : 🔍 Verify AVD Configuration
347+ run : |
348+ echo "=== AVD Configuration Check ==="
349+
350+ # Check if AVD directory exists
351+ echo "Checking AVD directory..."
352+ ls -la ~/.android/avd/ || echo "AVD directory not found"
353+
354+ # List available AVDs
355+ echo "Available AVDs:"
356+ emulator -list-avds || echo "Failed to list AVDs"
357+
358+ # Check Android SDK location
359+ echo "Android SDK location:"
360+ echo $ANDROID_HOME
361+ echo $ANDROID_SDK_ROOT
362+
363+ # Check emulator binary
364+ echo "Emulator binary:"
365+ which emulator || echo "Emulator not found in PATH"
366+ emulator -version || echo "Failed to get emulator version"
367+
368+ echo "=== AVD Check Complete ==="
369+
346370 - name : 🦾 Enable KVM
347371 run : |
348372 echo "=== KVM Setup and Verification ==="
@@ -427,7 +451,7 @@ jobs:
427451 api-level : ${{ matrix.api-level }}
428452 force-avd-creation : false
429453 # arch: ${{ matrix.arch }}
430- emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only
454+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 1024
431455 working-directory : ${{ github.workspace }}
432456 disable-animations : false
433457 script : echo "Generated AVD snapshot for caching."
@@ -438,7 +462,7 @@ jobs:
438462 with :
439463 api-level : ${{ matrix.api-level }}
440464 force-avd-creation : false
441- emulator-options : -no-snapshot-save -no- window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -accel auto - memory 2048 -cores 2 -qemu -enable-kvm
465+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 1024
442466 disable-animations : true
443467 working-directory : ${{ github.workspace }}
444468 script : |
@@ -448,6 +472,41 @@ jobs:
448472
449473 echo "=== Emulator Status Check ==="
450474 adb devices
475+
476+ # If no emulator is running, try to start one manually
477+ if ! adb devices | grep -q emulator; then
478+ echo "No emulator found, attempting manual startup..."
479+
480+ # List available AVDs
481+ echo "Available AVDs:"
482+ emulator -list-avds
483+
484+ # Try to start the first available AVD
485+ AVD_NAME=$(emulator -list-avds | head -1)
486+ if [ -n "$AVD_NAME" ]; then
487+ echo "Starting AVD: $AVD_NAME"
488+ emulator -avd "$AVD_NAME" -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 1024 &
489+ EMULATOR_PID=$!
490+ echo "Emulator started with PID: $EMULATOR_PID"
491+
492+ # Wait for emulator to boot
493+ echo "Waiting for emulator to boot..."
494+ for i in {1..60}; do
495+ if adb devices | grep -q emulator; then
496+ echo "Emulator is now available"
497+ break
498+ fi
499+ echo "Waiting... ($i/60)"
500+ sleep 10
501+ done
502+ else
503+ echo "No AVDs available"
504+ fi
505+ fi
506+
507+ echo "=== Final Emulator Status ==="
508+ adb devices
509+
451510 echo "=== Emulator Info ==="
452511 adb shell getprop ro.build.version.release || echo "Failed to get Android version"
453512 adb shell getprop ro.product.model || echo "Failed to get device model"
0 commit comments