android-calculatorpp/app/misc/other/prepare_avds.sh

70 lines
2.0 KiB
Bash
Raw Normal View History

2012-11-22 16:19:14 -05:00
#!/bin/bash
2012-11-24 12:12:35 -05:00
declare -a densities=("160" "213" "240" "320")
2012-11-25 15:00:30 -05:00
declare -a resolutions=("480x640" "480x800" "480x854" "640x960" "1024x600" "1024x768" "1280x768")
2012-11-22 16:19:14 -05:00
declare -a targets=("android-16")
for target in ${targets[@]}
do
2012-11-24 12:12:35 -05:00
for density in ${densities[@]}
2012-11-22 16:19:14 -05:00
do
2012-11-24 12:12:35 -05:00
for resolution in ${resolutions[@]}
do
name="AVD"
name="$name$density"
name="$name$resolution"
name="$name$target"
echo "Creating AVD $name"
echo "Density: $density"
echo "Resolution: $resolution"
echo "Target: $target"
$ANDROID_HOME/tools/android -s create avd -n $name -t $target -b x86 --force -s $resolution
if grep -R "hw.lcd.density" $HOME/.android/avd/$name.avd/config.ini
then
# replace density in config.ini
sed -i "s/hw.lcd.density=240/hw.lcd.density=$density/g" $HOME/.android/avd/$name.avd/config.ini
else
# code if not found
echo "hw.lcd.density=$density" >> $HOME/.android/avd/$name.avd/config.ini
fi
2012-11-24 12:12:35 -05:00
echo "sdcard.size=64M" >> $HOME/.android/avd/$name.avd/config.ini
echo "vm.heapSize=48" >> $HOME/.android/avd/$name.avd/config.ini
echo "hw.ramSize=256" >> $HOME/.android/avd/$name.avd/config.ini
2012-11-24 12:12:35 -05:00
#arr=(${resolution//x/ })
#echo "hw.lcd.width = ${arr[0]}" >> $HOME/.android/avd/$name.avd/config.ini
#echo "hw.lcd.height = ${arr[1]}" >> $HOME/.android/avd/$name.avd/config.ini
2012-11-24 12:12:35 -05:00
done
2012-11-22 16:19:14 -05:00
done
done
for target in ${targets[@]}
do
2012-11-24 12:12:35 -05:00
for density in ${densities[@]}
2012-11-22 16:19:14 -05:00
do
2012-11-24 12:12:35 -05:00
for resolution in ${resolutions[@]}
do
name="AVD"
name="$name$density"
name="$name$resolution"
name="$name$target"
$ANDROID_HOME/tools/emulator -avd $name &
$ANDROID_HOME/tools/monkeyrunner ./wait_device.py
$ANDROID_HOME/platform-tools/adb -s emulator-5580 emu kill
2012-11-24 12:12:35 -05:00
done
2012-11-22 16:19:14 -05:00
done
done