This commit is contained in:
Sergey Solovyev
2012-11-30 16:16:09 +04:00
parent 476f6352d2
commit 324bbda552
673 changed files with 16589 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,69 @@
#!/bin/bash
declare -a densities=("160" "213" "240" "320")
declare -a resolutions=("480x640" "480x800" "480x854" "640x960" "1024x600" "1024x768" "1280x768")
declare -a targets=("android-16")
for target in ${targets[@]}
do
for density in ${densities[@]}
do
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
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
#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
done
done
done
for target in ${targets[@]}
do
for density in ${densities[@]}
do
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
done
done
done

View File

@@ -0,0 +1,24 @@
#!/bin/bash
declare -a densities=("160" "213" "240" "320")
declare -a resolutions=("320x480" "480x640" "480x800" "480x854" "640x960" "1024x600" "1024x768" "1280x768" "1536x1152" "1920x1200")
declare -a targets=("android-16")
for target in ${targets[@]}
do
for density in ${densities[@]}
do
for resolution in ${resolutions[@]}
do
name="AVD"
name="$name$density"
name="$name$resolution"
name="$name$target"
$ANDROID_HOME/tools/android -s delete avd -n $name
done
done
done

View File

@@ -0,0 +1,77 @@
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import time
import sys
outFolder = sys.argv[1]
outFilename = sys.argv[2]
print ''
print 'Screenshot will be located in ' + outFolder + ' with name ' + outFilename;
apk = '/home/serso/projects/java/android/calculatorpp/calculatorpp/misc/other/tmp/2012.11.25/calculatorpp.apk'
package = 'org.solovyev.android.calculator'
activity = 'org.solovyev.android.calculator.CalculatorActivity'
mobileActivity = 'org.solovyev.android.calculator.CalculatorActivityMobile'
operatorsActivity = 'org.solovyev.android.calculator.math.edit.CalculatorOperatorsActivity'
deviceName = 'emulator-5580'
def takeScreenshot (folder, filename):
screenshot = device.takeSnapshot()
screenshot.writeToFile(folder + '/' + filename + '.png','png')
return
print 'Waiting for device ' + deviceName + '...'
device = MonkeyRunner.waitForConnection(100, deviceName)
if device:
print 'Device found, removing application if any ' + package + '...'
device.removePackage(package)
print 'Installing apk ' + apk + '...'
device.installPackage(apk)
runComponent = package + '/' + activity
print 'Starting activity ' + runComponent + '...'
device.startActivity(component=runComponent)
# sleep while application will be loaded
MonkeyRunner.sleep(15);
print 'Taking screenshot...'
#outFilename = outFilename + '_' + str(time.time())
takeScreenshot(outFolder, outFilename);
runComponent = package + '/' + operatorsActivity
print 'Starting activity ' + runComponent + '...'
device.startActivity(component=runComponent)
# sleep while application will be loaded
MonkeyRunner.sleep(4);
print 'Taking screenshot...'
#outFilename = outFilename + '_' + str(time.time())
takeScreenshot(outFolder, outFilename + '_operators');
runComponent = package + '/' + mobileActivity
print 'Starting activity ' + runComponent + '...'
device.startActivity(component=runComponent)
# sleep while application will be loaded
MonkeyRunner.sleep(4);
print 'Taking screenshot...'
#outFilename = outFilename + '_' + str(time.time())
takeScreenshot(outFolder, outFilename + '_mobile');
print '#########'
print 'Finished!'
print '#########'
else:
print '#########'
print 'Failure!'
print '#########'

View File

@@ -0,0 +1,49 @@
#!/bin/bash
predefined=1
scale=0.51
# first predefined
if [ $predefined -eq 1 ]
then
declare -a names=("AVD_Galaxy_Tab" "AVD_Nexus_S_by_Google" "AVD_Nexus_One_by_Google" "AVD_Nexus_7_by_Google" "AVD_Galaxy_Nexus_by_Google")
for name in ${names[@]}
do
$ANDROID_HOME/tools/emulator -ports 5580,5581 -avd $name -scale $scale &
sleep 50
$ANDROID_HOME/tools/monkeyrunner ./take_screenshots.py ~/projects/java/android/calculatorpp/calculatorpp/misc/other/tmp/2012.11.25 $name
$ANDROID_HOME/platform-tools/adb -s emulator-5580 emu kill
sleep 3
done
fi
# then all others
declare -a densities=("160" "213" "240" "320")
#declare -a densities=("213" "240" "320")
declare -a resolutions=("480x640" "480x800" "480x854" "640x960" "1024x600" "1024x768" "1280x768")
#declare -a resolutions=("480x640")
declare -a targets=("android-16")
for target in ${targets[@]}
do
for density in ${densities[@]}
do
for resolution in ${resolutions[@]}
do
name="AVD"
name="$name$density"
name="$name$resolution"
name="$name$target"
$ANDROID_HOME/tools/emulator -ports 5580,5581 -avd $name -scale $scale &
sleep 5
$ANDROID_HOME/tools/monkeyrunner ./take_screenshots.py ~/projects/java/android/calculatorpp/calculatorpp/misc/other/tmp/2012.11.25 $name
$ANDROID_HOME/platform-tools/adb -s emulator-5580 emu kill
sleep 3
done
done
done

View File

@@ -0,0 +1,19 @@
#!/bin/bash
predefined=1
scale=0.51
# first predefined
if [ $predefined -eq 1 ]
then
declare -a names=("AVD_Nexus_7_by_Google")
for name in ${names[@]}
do
$ANDROID_HOME/tools/emulator -ports 5580,5581 -avd $name -scale $scale &
sleep 50
$ANDROID_HOME/tools/monkeyrunner ./take_screenshots.py ~/projects/java/android/calculatorpp/calculatorpp/misc/other/tmp/2012.11.25 $name
$ANDROID_HOME/platform-tools/adb -s emulator-5580 emu kill
sleep 3
done
fi

View File

@@ -0,0 +1,10 @@
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
print 'Waiting for device...'
device = MonkeyRunner.waitForConnection(100, 'emulator-5580')
print 'Finished'
if device :
print 'Success'
else :
print 'Failure'

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Binary file not shown.