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
2 answers

What can I do to run monkey on Jenkins

I would like to run monkey on Jenkins but after use configuration: https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=57181910 I see in monkey.txt file: No activities found to run, monkey aborted. $ E:\server\AndroidSDK/platform-tools/adb.exe…
Unii
  • 1,587
  • 15
  • 33
0
votes
2 answers

Trying to remove malware code with find and sed

Some stupid monkeys wasted their and my time infecting one of our websites. Now, it seems that the website has been compromised via ftp and a whole bunch of files have been infected. Having changed the ftp credentials, my idea now was to run find…
Jan
  • 42,290
  • 8
  • 54
  • 79
-1
votes
1 answer

why System.err.println stuck at write?

Does anyone know why System.err.println is stuck at write? Issue happen during monkey test, check the code, it is stuck at System.err.println(s); here is calling stack: "main" prio=10 tid=1 Native | group="main" sCount=1 dsCount=0 flags=1…
-1
votes
1 answer

adb - How to remove the invisible new line character from a Python variable?

I use the MonkeyRunner tool which provides an API in order to manage an Android emulator or device through a script written in Python. I have assigned a process_id of an application using pid = device.shell('pidof [s] PACKAGE_NAME') command. When I…
talha06
  • 6,206
  • 21
  • 92
  • 147
-1
votes
1 answer

Detecting out of package issue in Android Testing with ADB Shell

I create a set of random adb shell events as an Android test case. Then I run this test on an app to collect some data for my research. The only problem is that sometimes those random events do something (e.g., clicking on HOME, BACK,or CLOSE etc.)…
-1
votes
1 answer

How to use Chaos Monkey on local cluster

I have a cluster back in my office for testing purposes. I have there a database and i would like to make all kind of "monekybusiness" to those test machines, long before i want to go to production. I zipped 2-3 coffees all this morning trying to…
Mr'Black
  • 274
  • 1
  • 6
  • 19
-1
votes
1 answer

adb.exe is not a valid Win32 application

I am trying to use monkey for Testing in android (http://developer.android.com/tools/help/monkey.html). I understand that for this to work, I need to configure adb on my command line. I have added the adb.exe to my system's environment variables…
wolfaviators
  • 503
  • 1
  • 7
  • 21
-1
votes
2 answers

how to simulate touch at specific location providing (x,y) coordianates in android programatically

I am developing an android app which involves connecting mouse to your phone wirelessly so that,we can operate our phone using mouse...i've implemented almost everything but couldnt figure out the way to simulate human touch at…
shunryui nik
  • 82
  • 1
  • 8
-1
votes
1 answer

DexGuard with UiAutomator and Monkey(not monkey runner)

has anyone used uiautomator or monkey to automate ui testing for an app that has been obfuscated by Dexguard? could you share your experience? like could uiautomator identify the widget by resourceID/Text etc. or if monkey could still run its…
-1
votes
1 answer

execute sensor events in android through adb or monkey tool

Is there any command to perform sensor event in device using monkey or adb like using monkey we can perform so many commands for touch long press etc.but i am not getting any sensor commands Does anyone have idea about this please share. Thanks in…
ankita gahoi
  • 1,532
  • 2
  • 15
  • 28
1 2 3
9
10