Skip to content

Commit 4e9b226

Browse files
committed
Fix github action
1 parent ce21f45 commit 4e9b226

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/android-build.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,32 @@ jobs:
4343
4444
- name: Create AVD
4545
run: |
46-
cd $ANDROID_HOME/cmdline-tools/latest/bin
47-
echo no | ./avdmanager create avd -n test -k "system-images;android-30;google_apis;x86" --force
46+
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
47+
echo "no" | avdmanager create avd -n test -k "system-images;android-30;google_apis;x86" --force
48+
49+
- name: List AVDs (debug)
50+
run: |
51+
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
52+
avdmanager list avd
4853
4954
- name: Start ADB Server
5055
run: adb start-server
5156

5257
- name: Start Emulator
5358
run: |
5459
echo "Starting emulator..."
55-
export PATH=$PATH:$ANDROID_HOME/emulator
56-
emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics &
60+
export PATH=$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/latest/bin
61+
# Verify AVD exists before starting
62+
avdmanager list avd
63+
emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics -verbose &
64+
65+
- name: Wait for emulator
66+
run: |
5767
# Wait for the emulator to start up
58-
sleep 120
68+
echo "Waiting for emulator to boot..."
69+
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
70+
adb devices
71+
echo "Emulator is ready"
5972
6073
- name: Export CLOUDINARY_URL
6174
run: |

0 commit comments

Comments
 (0)