From f187b519f0734adc394ab963ec06304bb075c62d Mon Sep 17 00:00:00 2001 From: DjBushido Date: Fri, 30 May 2014 22:04:41 -0400 Subject: [PATCH] Add the wait_for_emulator script --- .travis.yml | 11 ++++++++++- wait_for_emulator | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 wait_for_emulator diff --git a/.travis.yml b/.travis.yml index 50982ac..a4791d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,10 @@ -language: android \ No newline at end of file +language: android +env: + matrix: + - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a +before_install: + - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI + - emulator -avd test -no-skin -no-audio -no-window & +before_script: + - ./wait_for_emulator + - adb shell input keyevent 82 & \ No newline at end of file diff --git a/wait_for_emulator b/wait_for_emulator new file mode 100644 index 0000000..207f028 --- /dev/null +++ b/wait_for_emulator @@ -0,0 +1,17 @@ +#!/bin/bash + +bootanim="" +failcounter=0 +until [[ "$bootanim" =~ "stopped" ]]; do + bootanim=`adb -e shell getprop init.svc.bootanim 2>&1` + echo "$bootanim" + if [[ "$bootanim" =~ "not found" ]]; then + let "failcounter += 1" + if [[ $failcounter -gt 3 ]]; then + echo "Failed to start emulator" + exit 1 + fi + fi + sleep 1 +done +echo "Done" \ No newline at end of file