Fixed issue #90

This commit is contained in:
butomo1989
2018-08-03 15:58:07 +02:00
parent 735bc64a2d
commit d7c9730712
3 changed files with 33 additions and 25 deletions
+20 -6
View File
@@ -4,9 +4,9 @@ function wait_emulator_to_be_ready () {
boot_completed=false
while [ "$boot_completed" == false ]; do
status=$(adb wait-for-device shell getprop sys.boot_completed | tr -d '\r')
echo "Boot Status: $boot_completed"
echo "Boot Status: $status"
if [ "$boot_completed" == "1" ]; then
if [ "$status" == "1" ]; then
boot_completed=true
else
sleep 1
@@ -14,17 +14,31 @@ function wait_emulator_to_be_ready () {
done
}
function install_google_play_service () {
function change_language_if_needed() {
if [ ! -z "${LANGUAGE// }" ] && [ ! -z "${COUNTRY// }" ]; then
wait_emulator_to_be_ready
echo "Languge will be changed to ${LANGUAGE}-${COUNTRY}"
adb root && adb shell "setprop persist.sys.language $LANGUAGE; setprop persist.sys.country $COUNTRY; stop; start"
echo "Language is changed!"
fi
}
function install_google_play () {
wait_emulator_to_be_ready
adb install -r "/root/google_play_service.apk"
echo "Google Play Service will be installed"
adb install -r "/root/google_play_services.apk"
echo "Google Play Store will be installed"
adb install -r "/root/google_play_store.apk"
}
function disable_animation () {
# this is for demonstration what other amazing staff can be done here
# To improve performance
adb shell "settings put global window_animation_scale 0.0"
adb shell "settings put global transition_animation_scale 0.0"
adb shell "settings put global animator_duration_scale 0.0"
}
install_google_play_service
change_language_if_needed
sleep 1
install_google_play
disable_animation