forked from TheSoftwareFactory/lokki-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathavd-test.sh
executable file
·34 lines (33 loc) · 1.04 KB
/
avd-test.sh
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
set -e
function disable_animation() {
echo "Disabling animations"
echo " Opening Developer Settings"
adb shell am start -W -n com.android.settings/.DevelopmentSettings
echo " Scroll to Window animation scale"
for i in {1..23}; do
adb shell input keyevent 20
done
echo " Set Window animation, Transition scale and Animator duration scale to 0x"
for i in {1..3}; do
adb shell input keyevent 20
adb shell input keyevent 23
adb shell input keyevent 19
adb shell input keyevent 19
adb shell input keyevent 23
done
adb shell input keyevent 3
echo "Done"
}
if [ ! -d "$HOME/.android/avd/$NAME.avd" ] || [ ! -f "$HOME/.android/avd/$NAME.ini" ]; then
echo "no" | android create avd --force -n "$NAME" -t "$TARGET" --abi armeabi-v7a
emulator -avd "$NAME" -no-audio -no-window &
android-wait-for-emulator
adb shell input keyevent 82
disable_animation
else
echo "Using AVD cache"
emulator -avd "$NAME" -no-audio -no-window &
android-wait-for-emulator
adb shell input keyevent 82 &
fi