报错信息:
Exception occurred while executing 'keyevent':
java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
解决方案:权限不足导致。设置里搜索‘开发者选项’,开启‘USB调试’、‘USB调试(安全设置)’,关闭‘启用系统优化’。三者缺一不可。
开发者选项的显示需要开启开发者模式,开启方式:
设置-我的设备-全部参数与信息-连点八次OS版本。