-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
34 lines (28 loc) · 1.12 KB
/
docker-entrypoint.sh
File metadata and controls
34 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# launch the emulator
exec /opt/adk/tools/emulator -avd Android -no-boot-anim -no-snapshot-save -no-audio -no-window &
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
# https://raw.githubusercontent.com/travis-ci/travis-cookbooks/0f497eb71291b52a703143c5cd63a217c8766dc9/community-cookbooks/android-sdk/files/default/android-wait-for-emulator
set +e
bootanim=""
failcounter=0
timeout_in_sec=360
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done
# setup appium
while [ -z $udid ]; do
udid=`adb devices | grep emulator | cut -f 1`
done
# http://appium.io/docs/en/writing-running-appium/server-args/
exec appium -p 4723 -bp 5037 --default-capabilities '{"udid":"'${udid}'"}' &