mirror of
https://onedev.site.tesses.net/Dependencies/AndroidDotnetDocker
synced 2026-02-09 02:25:45 +00:00
Build android dotnet
This commit is contained in:
30
tools/android-wait-for-emulator.sh
Executable file
30
tools/android-wait-for-emulator.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
|
||||
bootcomplete=""
|
||||
failcounter=0
|
||||
timeout=600
|
||||
sleeptime=10
|
||||
maxfail=$((timeout / sleeptime))
|
||||
|
||||
until [[ "${bootcomplete}" =~ "1" ]]; do
|
||||
bootcomplete=`adb -e shell getprop dev.bootcomplete 2>&1 &`
|
||||
if [[ "${bootcomplete}" =~ "" ]]; then
|
||||
((failcounter += 1))
|
||||
echo "Waiting for emulator to start"
|
||||
if [[ ${failcounter} -gt ${maxfail} ]]; then
|
||||
echo "Timeout ($timeout seconds) reached; failed to start emulator"
|
||||
while pkill -9 "emulator" >/dev/null 2>&1; do
|
||||
echo "Killing emulator process...."
|
||||
pgrep "emulator"
|
||||
done
|
||||
echo "Process terminated"
|
||||
pgrep "emulator"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
sleep ${sleeptime}
|
||||
done
|
||||
|
||||
echo "Emulator is ready"
|
||||
Reference in New Issue
Block a user