views:

42

answers:

2

Hi,

I currently use the Android Monkey tool for stress testing Android system/packages. I find it to be useful. But so far everything has been manual testing (i.e. open emulator, execute adb shell monkey <...>, etc.). I'd like to "automate" this and have it triggered externally by a build server.

My initial instinct is to just write a shell script to execute monkey (using random seeds) and then store the results in an build server accessible file. But is this really useful?

Just curious if anyone has done this before and/or has a "smarter" idea for automating Android Monkey runs. A Google search using terms "automating android monkey" turned up little relevant information.

All thoughts welcome.

+1  A: 

You could look at Hudson - that should be able to start an emulator and then do your android monkey commands.

Richard Green
This, plus the Hudson Android Emulator plugin.
Christopher
Absolutely - that's what I meant but just didn't state it :-/
Richard Green
Great feedback! I already have the build server starting an emulator instance and running a bunch of InstrumentationTestCases and presenting the results. I had hoped there was someone out there who specifically automated Monkey runs and found it to be useful/not-useful (a kind of lessons learned for automating Monkey).
David M Strickland
Feel free to click on the green tick then !!
Richard Green
A: 

Update:

I decided to go with a simple shell script since I couldn't think of anything "smarter" to do. It's still a work in progress. Here it is at it's current state:

#!/bin/bash

REPORTROOT=./reports

# remove old report files
echo "Removing old output report files..."
rm $REPORTROOT

# make dir for new report files
echo "Output reports will be stored in $REPORTROOT..."
mkdir $REPORTROOT

# run monkey on the entire system
echo "Running Monkey on entire system..."
adb -e shell monkey -v -v -v 500 > $REPORTROOT/monkey_sys.txt
# pull the log file from device?

# run monkey on particular packages
# packages here...

# create composite report
echo "Running reports..."
grep -A 5 -h -r CRASH $REPORTROOT > $REPORTROOT/crash_report.txt

The output is a simple .txt file with a few lines about any crashes.

David M Strickland