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

Monkey patching a class in another module in Python with other imports

I am trying to monkey patch a python module to override a method within the class. This is a proxy module for simplification and not the actual code or module I am overwriting but follows the same structure. The module looks like…
mrkanuke
  • 3
  • 3
0
votes
0 answers

Vipermonkey/ cannot import from logger import log and from core.meta import get_metadata.exif error. How can I solve them?

When I run the command "C:\Users\X\ViperMonkey-master\vipermonkey>python vmonkey.py -f C:\Users\X\Desktop\Example.docx", I get the following error. How can I solve it? C:\Users\X\ViperMonkey-master\vipermonkey>python vmonkey.py -f…
mermer
  • 1
0
votes
0 answers

Android Monkey stop home button not working

Before saying that this is a duplicate, it is not as the previous answers have not helped me. So I was trying to incorporate some monkey testing on an emulator to find bugs in my code. But, I have an issue with the monkey leaving my application and…
0
votes
0 answers

Android firebase robo test with webview

Is it any solution to run any robo tests with first screen as webview (webview used for authentication) or maybe somehow can skip this first activity with webview and run robo test after that webview?
Slava
  • 443
  • 4
  • 12
0
votes
0 answers

How to solve Monkey and Bananas Graphplan and JavaGP?

Helo everyone,n I can't find what's the problem with my planning here that makes the goal unsolvable. I would like to ask what could be the problem here? Problem.txt: start( at(Monkey, a), at(Banana, b), at(Box, c), height(Monkey,…
Arvuz10
  • 1
  • 1
0
votes
1 answer

No activities found to run, monkey aborted

Tried to run monkey on my device(xiaomi); getting this error, but other device(samsung) working fine with monkey command. C:\Users\naresh>adb -s shell monkey -p com.an.biometric.sample -c android.intent.category.LAUNCHER 1 bash arg: -p …
naresh
  • 1
  • 1
  • 3
0
votes
0 answers

Golang:module declares its path as: bou.ke/monkey, but was required as: github.com/bouk/monkey

I want to have a mock test, so I import the github.com/bouk/monkey, it still can't work and give the following message. I couldn't find the answer anywhere, could somebody help? PS D:\xxx\awesomeGo> go get -u github.com/bouk/monkey go get:…
Wu-Yikun
  • 35
  • 8
0
votes
0 answers

How to check if Monkey accepts the seed?

I'm taking measurements with Monkey on Android. For the type of analysis I have to do, I need to generate the same sequence of events for each experiment. So, in every experiment, I always use the adb shell monkey command with the same seed. For…
Luigi
  • 181
  • 3
  • 15
0
votes
0 answers

kill Android application launched with Monkey without root permissions

I am using Monkey to take measurements on an Android device. I launch a series of applications and after a certain amount of time I should kill one. Is it possible to do this without unlocking the root permissions on the smartphone? I've tried…
Luigi
  • 181
  • 3
  • 15
0
votes
1 answer

Binary search between two files in C

I'm trying to apply some previously written code to some DNA sequencing data that I have collected. I would like to match my sequencing reads to a document containing specific barcodes and output the number of hits for each match. I am having some…
0
votes
1 answer

XCUITest waits for apps that are not tested to reach idle state

During the execution of my use case, I clicked to jump to a third-party APP, such as AppStore or browser Then XCUITest has been waiting for the third-party APP to reach the idle state The test fails because it cannot find the test target…
PX Cheng
  • 101
  • 1
  • 6
0
votes
1 answer

Inspect time delay for the app to launch in Monkey tool

I'm trying to find out the time-lapsed for the app to launch using the Moneky tool for a specific package. I'm not familiar with what kind of command line could give the time delay the app takes to launch. What if I want to run the same command…
0
votes
0 answers

Activity has register in AndroidManifest.xml,but it will ActivityNotFoundException when Monkey is running

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.actionxxx dat=sms:xxxxxxxxxxx } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632) at…
0
votes
1 answer

Device freeze screen once using monkey test from an application

I have just made an android application as System app to start monkey command for Calculator package. My app has a button and it will start monkey once clicked. public void onClick(View v) { try { Runtime.getRuntime().exec("monkey -p…
0
votes
1 answer

AndroidViewClient - How to get notified when the Android Virtual Device start process is completed?

I use AndroidViewClient in order to use MonkeyRunner through Python. I need to start the AVD programmatically and get notified when the AVD start process is completed. How can I catch that event? The execution just does not reach the line after the…