Based on reading, the values window_animation_scale
, transition_animation_scale
and animator_duration_scale
need to be set to 0
The following works for API 22 but not for API 23:
adb shell settings put global window_animation_scale 0.0
Even the below command did not work for API 23
adb shell content update --uri content://settings/system --bind value:s:0.0 --where 'name="window_animation_scale"'
We want to disable animations to prevent flaky visual test failures only. We do not want to introduce this logic in the application and hence want to apply it at the system level rather than through the application.
Open Settings . Scroll down and select Accessibility. Scroll down to Display and tap Text and display. Tap the toggle switch for Remove animations to turn it on.
To stop the adb server, use the adb kill-server command. You can then restart the server by issuing any other adb command.
If you're trying to make a lower resource handset feel a bit snappier, go ahead and disable all animations completely. That should both make the phone feel faster and be less taxing on the limited hardware.
The answer to this question is no. You cannot enable USB debugging using an ADB command. This is because executing an ADB command requires you to already have USB debugging enabled on your phone. If USB debugging is not turned on, ADB cannot communicate with your device.
You can execute the following adb commands to disable the animations:
adb shell settings put global window_animation_scale 0 adb shell settings put global transition_animation_scale 0 adb shell settings put global animator_duration_scale 0
Also, you could take a look at this repo
Build the project and download the generated .apk file and follow the instructions mentioned in that project to disable the animations and you should have a smooth sailing afterwards. You could also download the same .apk file from a lot of other sources (go google!).
Once you have the .apk file then issue the following commands:
adb install -r android_emulator_hacks.apk adb shell pm grant no.finn.android_emulator_hacks android.permission.SET_ANIMATION_SCALE adb shell am start -n no.finn.android_emulator_hacks/no.finn.android_emulator_hacks.HackActivity
The answer by Mark W should be accepted You can also save it as a shell script for convenience, i.e.:
#!/bin/sh 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
then in terminal just call
sh path/to/file.sh
Or go one step further and save an alias shortcut in your bash profile :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With