Showing
2 changed files
with
1 additions
and
27 deletions
ci/wait.sh
deleted
100755 → 0
| 1 | -#!/bin/bash | ||
| 2 | - | ||
| 3 | -# Based on https://medium.com/@nocnoc/flutter-unit-widget-and-integration-testing-with-ios-and-android-emulators-on-travis-ci-df17ed7c3be | ||
| 4 | -# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain | ||
| 5 | - | ||
| 6 | -set +e | ||
| 7 | - | ||
| 8 | -bootanim="" | ||
| 9 | -failcounter=0 | ||
| 10 | -timeout_in_sec=360 | ||
| 11 | - | ||
| 12 | -until [[ "$bootanim" =~ "stopped" ]]; do | ||
| 13 | - bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &` | ||
| 14 | - if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" | ||
| 15 | - || "$bootanim" =~ "running" ]]; then | ||
| 16 | - let "failcounter += 1" | ||
| 17 | - echo "Waiting for emulator to start" | ||
| 18 | - if [[ $failcounter -gt timeout_in_sec ]]; then | ||
| 19 | - echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" | ||
| 20 | - exit 1 | ||
| 21 | - fi | ||
| 22 | - fi | ||
| 23 | - sleep 1 | ||
| 24 | -done | ||
| 25 | - | ||
| 26 | -echo "Emulator is ready" |
-
Please register or login to post a comment