File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff 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 &
3940script :
4041- jdk_switcher use oraclejdk8
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments