Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ideas for automating Android Monkey runs

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.

like image 724
dstricks Avatar asked Oct 19 '10 12:10

dstricks


2 Answers

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.

like image 76
dstricks Avatar answered Sep 23 '22 03:09

dstricks


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

like image 45
Richard Green Avatar answered Sep 24 '22 03:09

Richard Green