小米手机adb命令报错

出错:

Exception occurred while executing 'swipe':
java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.

at com.android.server.input.InputManagerService.injectInputEventToTarget(InputManagerService.java:912)
        at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1217)
        at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1227)
        at com.android.server.input.InputShellCommand.injectMotionEvent(InputShellCommand.java:196)
        at com.android.server.input.InputShellCommand.sendSwipe(InputShellCommand.java:430)
        at com.android.server.input.InputShellCommand.runSwipe(InputShellCommand.java:414)
        at com.android.server.input.InputShellCommand.onCommand(InputShellCommand.java:257)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.input.InputManagerService.onShellCommand(InputManagerService.java:3435)
        at android.os.Binder.shellCommand(Binder.java:1075)
        at android.os.Binder.onTransact(Binder.java:895)
        at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:1372)
        at android.os.Binder.execTransactInternal(Binder.java:1351)
        at android.os.Binder.execTransact(Binder.java:1282)
 

解决方法:

        打开开发者选项 ,小米手机是点进我的设备,进入全部参数然后连续点击系统版本号进入开发者模式。

        设置>>更多设置>>开发者选项>>开启USB调试及USB调试(安全设置)。

        如果仍报错,则在系统跟踪中关闭跟踪。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值