Running Monkey Test on Mi Device Returning exception
Asked Answered
A

1

5

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?

Acrylyl answered 11/1, 2018 at 10:3 Comment(1)
Try see answers here: #5383901Backflow
A
12

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

This worked for me !!

Acrylyl answered 12/1, 2018 at 9:18 Comment(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.Horsey
i have a android 12, xiaomi note 10 pro, trying to send keyevent, and enabled the the same setting, still the same errorAmbary
@DjWalkzz you've probably solved it, but restart your phone :)Adulterous
yeah, i solved it by restarting phone :DAmbary

© 2022 - 2024 — McMap. All rights reserved.