Skip to content

Commit 1a12978

Browse files
vchimevvchimev
authored andcommitted
chore(travis): Increase android emulator timeout
1 parent 5b60043 commit 1a12978

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ before_script:
3333
- npm install
3434
- echo no | android create avd --force -n $AVD_NAME -t android-$EMULATOR_API_VER --abi
3535
default/armeabi-v7a -c 12M
36-
- emulator -avd $AVD_NAME -no-audio -no-window &
37-
- android-wait-for-emulator
36+
- emulator -avd $AVD_NAME -no-audio -no-skin -no-window &
37+
# - android-wait-for-emulator
38+
- ./build/travis-scripts/android-wait-for-emulator
3839
- adb shell input keyevent 82 &
3940
script:
4041
- jdk_switcher use oraclejdk8
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
4+
# https://github.com/travis-ci/travis-cookbooks/blob/master/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
5+
6+
set +e
7+
8+
bootanim=""
9+
failcounter=0
10+
timeout_in_sec=600 # 10 minutes
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"

0 commit comments

Comments
 (0)