Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccarthyIrl committed Mar 9, 2024
1 parent d430192 commit f6f0cf6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/scripts/startEmulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,24 @@ nohup "$ANDROID_HOME"/emulator/emulator -avd testRunnner \
-qemu -lcd-density 420 > /dev/null 2>&1 &

# Wait for the emulator to fully boot
while [ -z "$(adb shell getprop sys.boot_completed | tr -d '\r')" ]; do
echo "Sleeping"
sleep 1
tries=0
while [ $tries -lt 10 ]; do
if $ADB devices | grep -q emulator; then
break
fi
echo "Waiting for emulator to be detected..."
sleep 5
tries=$((tries + 1))
done

if ! $ADB devices | grep -q emulator; then
echo "Emulator not detected after multiple attempts. Exiting."
exit 1
fi

# Additional sleep for stability
sleep 10

echo "Connected Devices:"
$ADB devices
echo "Emulator started"
echo "Emulator started"

0 comments on commit f6f0cf6

Please sign in to comment.