Skip to content

Commit 2a6f827

Browse files
committed
Fix github action
1 parent 421a825 commit 2a6f827

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/android-build.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,27 @@ jobs:
5252
run: |
5353
echo "Starting emulator..."
5454
export PATH=$PATH:$ANDROID_HOME/emulator
55-
emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics &
56-
# Wait for emulator to fully boot
57-
sleep 120
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
58+
echo "Waiting for emulator device..."
59+
adb wait-for-device
60+
61+
# Poll for full boot
62+
boot_completed=""
63+
echo "Waiting for emulator to boot..."
64+
until [[ "$boot_completed" == "1" ]]; do
65+
sleep 5
66+
boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
67+
done
68+
69+
# Optional: unlock the screen (some test frameworks expect an unlocked device)
70+
adb shell input keyevent 82
71+
72+
echo "Emulator is fully booted."
73+
74+
- name: Verify emulator is running
75+
run: adb devices
5876

5977
- name: Export CLOUDINARY_URL
6078
run: |

0 commit comments

Comments
 (0)