androidmonkeyrunner

Running Monkey Test on Mi Device Returning exception


Crash:

java.lang.SecurityException: Injecting to another application 
           requires **INJECT_EVENTS** permission

Command:

adb shell monkey -p  PACKAGE_NAME -v -v --throttle 300
--pct-touch 40 --pct-motion 35 --pct-nav 0 --pct-majornav 0 --pct-appswitch 5 --pct-anyevent 5 --pct-trackball 0 --pct-syskeys 5 --pct-pinchzoom 5  --bugreport 100000

Any Ideas how to overcome this?


Solution

  • After enabling Usb Debugging Under Developer Options .Please Enable USB Debbugging(Security settings) under developer options itself.

    This worked for me !!