3

I am new to Monkey testing tool, it says run the following command

adb shell monkey -p "package name" -v 3

It is not clear to me whether to pass this command from inside the Project Directory or from the workspace where my Project is present.

Each time I run I get the following error

:Monkey: seed=0 count=3
:AllowPackage: com.and
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
** No activities found to run, monkey aborted.

Thanks in Advance

1
  • 1
    Check that you don't have applicationIdSuffix ".debug" anywhere in your gradle file
    – soshial
    May 2, 2018 at 17:47

2 Answers 2

3

When you're running a command using adb shell, the command is run on the connected Android device or emulator. So the current working directory for the command would be that of the device. How would it matter whether you execute it "from inside the Project Directory or from the workspace where my Project is present"?

Looking at the error you got, it's clear that you've not given the allowed package name correctly.

1
  • yes , I was not giving the package name correctly. Can you suggest me how to pass rotation event while testing through monkey tool Dec 12, 2012 at 11:18
2

Check your application whether it has an Activity (android.intent.category.LAUNCHER)or not in manifest file. If its not present you will get this error. Actually i am also testing mobile apps with monkey tool and got this error. If you have any doubt create a sample project with Activity & intent filter and run monkey tool.

4
  • Do you know how to pass rotation event while testing through monkey tool. Dec 12, 2012 at 12:01
  • I think so possible/not by monkey tool because it is a pseudo random events. and also check with below link groups.google.com/forum/#!msg/android-developers/9OktySxjoNA/…
    – saravana
    Dec 12, 2012 at 13:36
  • Just now tested with ICS device, Orientation happens when do manually while doing manually.:Sending Touch (ACTION_DOWN): 0:(41.0,741.0) :Sending Touch (ACTION_UP): 0:(38.0403,748.6024) :Sending Touch (ACTION_DOWN): 0:(370.0,478.0) :Sending Touch (ACTION_UP): 0:(377.42416,477.805) :Sending Flip keyboardOpen=true
    – saravana
    Dec 12, 2012 at 14:50
  • After spending some time just found something but i didnt tried this cmd-> adb shell monkey -p<package name> --pct-flip<percentage> -v 500 :Sending Touch (ACTION_DOWN): 0:(41.0,741.0) :Sending Touch (ACTION_UP): 0:(38.0403,748.6024) :Sending Touch (ACTION_DOWN): 0:(370.0,478.0) :Sending Touch (ACTION_UP): 0:(377.42416,477.805) :Sending Flip keyboardOpen=true
    – saravana
    Dec 12, 2012 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.