Questions tagged [monkey]

The Monkey is a program that runs on an Android emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. Monkey can be used to stress-test applications, in a random yet repeatable manner.

Overview

The Monkey is a command-line tool that that runs on any Android emulator instance or device. It sends a pseudo-random stream of user events into the system, which acts as a stress test on the application software you are developing.

The Monkey includes a number of options, but they break down into four primary categories:

Basic configuration options, such as setting the number of events to attempt. Operational constraints, such as restricting the test to a single package. Event types and frequencies. Debugging options. When the Monkey runs, it generates events and sends them to the system. It also watches the system under test and looks for three conditions, which it treats specially:

If you have constrained the Monkey to run in one or more specific packages, it watches for attempts to navigate to any other packages, and blocks them. If your application crashes or receives any sort of unhandled exception, the Monkey will stop and report the error. If your application generates an application not responding error, the Monkey will stop and report the error. Depending on the verbosity level you have selected, you will also see reports on the progress of the Monkey and the events being generated.

Basic Use of the Monkey

You can launch the Monkey using a command line on your development machine or from a script. Because the Monkey runs in the emulator/device environment, you must launch it from a shell in that environment. You can do this by prefacing adb shell to each command, or by entering the shell and entering Monkey commands directly.

The basic syntax is:

$ adb shell monkey [options] <event-count>

With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send events to any (and all) packages installed on your target. Here is a more typical command line, which will launch your application and send 500 pseudo-random events to it:

$ adb shell monkey -p your.package.name -v 500
145 questions
0
votes
1 answer

ClassNotFoundError while running AspectJ android project in Eclipse

I have an Android Project, I converted the same into AspectJ project for MonkeyTool but when we run this into emulator or device it returns ClassNotFoundError. I am not able to figure out this problem because the same project is running safely on…
Sanat Pandey
  • 4,081
  • 17
  • 75
  • 132
0
votes
2 answers

Is there any regex to find package name

I want to run monkey on game 2048 using adb So, i need package name of 2048, i used adb shell pm list packages -f to list packages. I could not find 2048 in it, but the application is installed on my device. Is there any regex by which i can look…
Saurabh Shrivastava
  • 1,394
  • 4
  • 21
  • 50
0
votes
1 answer

Monkey command on android phone?

I'm ok using monkey command on the emulator but is it possible to launch it on a phone i'm using for debug?
Sephy
  • 50,022
  • 30
  • 123
  • 131
0
votes
1 answer

Android Monkey: How to recreate actions/interpret output

I'm really just wondering if there's any in-depth online documentation for the output or for how to recreate an error brought upon by the monkey tool. I'm getting a log that looks like so... :Sending Touch (ACTION_UP):…
wizurd
  • 3,541
  • 3
  • 33
  • 50
0
votes
2 answers

Is http://sensormonkey.eeng.nuim.ie/ down? I need it for my sensors to work in the web

Last month, I have found sensormonkey which is a great website for streaming live sensor data from arduino via webpage. However when I accessed the website this morning, I received an HTTP 504 ERROR. http://sensormonkey.eeng.nuim.ie/ Is it just me?…
JexAce
  • 3
  • 3
0
votes
1 answer

How to detect adb monkey crashed the app?

I'm setting up a Jenkins job in order to run adb monkey on my app. I run the following command: adb shell monkey -p nl.tmg.telegraaf -v 500 In some cases it succeeds and sometimes it fails. However, the exit code is always 0. Hence jenkins treats…
Nasir
  • 1,982
  • 4
  • 19
  • 35
0
votes
1 answer

Error in monkey test android

I want to test my apk (package name : com.edutor.ignitor) with monkey. So i typed the following command adb shell monkey -p com.edutor.ignitor -v 200 getting error as follows :Monkey: seed=1403140033385 count=200 :AllowPackage:…
user3297196
  • 47
  • 2
  • 11
0
votes
1 answer

Error with messages in JMonkey Networking

So i was trying to do a Networking project using JMonkey. I followed the networking tutorial to pass messages (String) from the client to the server and vice versa and there was no problem. Then however when I tried to make my own version of it and…
Girauder
  • 165
  • 1
  • 12
0
votes
1 answer

Why the "adb shell monkey --wait-dbg" doesn't work?

I want to stop the running monkey by using the adb shell monkey --wait-dbg,but the result is only display like this:Sending WAIT chunkand then the monkey is still running. How to understand the command?The official explain is "Stops the Monkey from…
hsqzggg
  • 1
  • 2
0
votes
0 answers

Testing Application with Monkey

I'm trying to use Monkey to test the UI of my application but have so far been unsuccessful. I've connected my device to my computer and attempted to run monkey using adb. The command I'm using is: adb shell monkey -p com.cooper.redditvideo -v…
Scott Cooper
  • 2,779
  • 2
  • 23
  • 29
0
votes
0 answers

perf not working for some commands?

I'd like to use perf to profile the monkey command on Android, but I got stuck with this. Normally, when I run following: monkey -v -p com.google.android.youtube 500 -it works (it generates 500 user events for youtube) BUT, when I want to get…
0
votes
1 answer

Android monkey crashing on holoeverywhere

I'd like to test my app with the monkey testing tool, but it only gets up until 700 events, than it crashes with some vague log message: 07-18 13:56:44.600: E/AndroidRuntime(27622): FATAL EXCEPTION: main 07-18 13:56:44.600: E/AndroidRuntime(27622):…
Tamas
  • 1,765
  • 1
  • 16
  • 26
0
votes
2 answers

Monkey says no activities found

This used to work fine before in my setting, and now its giving this error even for a test application the default manifest file is shown below;
user1848880
  • 77
  • 10
0
votes
1 answer

how to open power shell window from a batch file to a new window

I am writing a DOS batch script file. My script will be doing following: make a directory with mkdir command spawn a powershell command to a new window ( not the same command window) I would like to open this power script in a new window run…
droigons
  • 255
  • 4
  • 16
0
votes
1 answer

Running MonkeyTalk script with ANT on Macosx

I'm try to run a MonkeyTalk script for my iOS app from command line. The script is successfully running in the MonkeyTalkIDE and get executed on the Simulator. I have build.xml and Monkey-tal.jar files in the same directory of test.mt The…
Claus
  • 5,662
  • 10
  • 77
  • 118
1 2 3
9
10