Are Android Animations Annoying You?

The Problem (Skip this section, if all you need is solution)

Finding

Solution

#!/usr/bin/env bash
set -e

EMULATOR_PROCESS_ID_FILE_PATH=~/.Nexus_25.pid

function open_device()
{
$ANDROID_HOME/emulator/emulator -avd Nexus_25 -no-boot-anim -no-audio -no-window > /dev/null &

echo $! > $EMULATOR_PROCESS_ID_FILE_PATH #pid of previous command execution
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 10; done' #Wait until home screen gets displayed
}


function modify_settings()
{
$ANDROID_HOME/platform-tools/adb shell "settings put global window_animation_scale 0.0
"
$ANDROID_HOME/platform-tools/adb shell "settings put global transition_animation_scale 0.0"
$ANDROID_HOME/platform-tools/adb shell "settings put global animator_duration_scale 0.0"

#change whatever settings you wish to.
}

function restart_device()
{
$ANDROID_HOME/platform-tools/adb shell "su 0 am start -a android.intent.action.REBOOT"
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 10; done' #Wait until home screen gets displayed
}

function switch_off_device()
{
kill -9 $(cat $EMULATOR_PROCESS_ID_FILE_PATH)
#Why this? Because we don't trust adb emu kill
rm $EMULATOR_PROCESS_ID_FILE_PATH
}


open_device
modify_settings
restart_device
switch_off_device

--

--

--

https://sagarmaurya.dev | BuyMeACoffee: https://www.buymeacoffee.com/sagarising

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sagar Maurya

Sagar Maurya

https://sagarmaurya.dev | BuyMeACoffee: https://www.buymeacoffee.com/sagarising

More from Medium

Paytm Payment Gateway Integration on Android Studio

Android Safe-Args in Navigations Components

Android, Aligning Views In a Circle Shape

MeowBottomNavigation-Kotlin