4

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?

Murmel
  • 5,402
  • 47
  • 53
Rumour
  • 310
  • 3
  • 20

1 Answers1

11

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

This worked for me !!

Rumour
  • 310
  • 3
  • 20
  • 4
    Yes, this setting for allowing input to applications is a bit lower in options then USB Debugging, For my Xiaomi phone it required Xiaomi account registration and 3 times confirmation. – Dzenly Dec 05 '20 at 06:10
  • i have a android 12, xiaomi note 10 pro, trying to send keyevent, and enabled the the same setting, still the same error – Dj Walkzz Dec 17 '22 at 07:43