You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

远程滑动解锁小米Poco 5X遇INJECT_EVENTS权限问题求助

问题:小米Poco 5X通过ADB执行滑动解锁时权限异常

环境配置

  • 小米Poco 5X开发机,具备远程ADB访问权限
  • 已安装Vyzor,因小米需启用额外调试标志,当前仅能查看屏幕

问题详情

设备仅需滑动操作即可解锁,已通过以下命令点亮屏幕:

adb -s XXXXX shell svc power stayon true

但执行滑动命令时触发权限异常:

adb -s XXXXX shell "input touchscreen swipe 126 459 913 472"

报错信息:

Exception occurred while executing 'touchscreen':
java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission
        at com.android.server.input.InputManagerService.injectInputEventInternal(InputManagerService.java:914)
        at com.android.server.input.InputManagerService.injectInputEvent(InputManagerService.java:866)
        at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1091)
        at com.android.server.input.InputShellCommand.injectMotionEvent(InputShellCommand.java:138)
        at com.android.server.input.InputShellCommand.sendSwipe(InputShellCommand.java:370)
        at com.android.server.input.InputShellCommand.runSwipe(InputShellCommand.java:354)
        at com.android.server.input.InputShellCommand.onCommand(InputShellCommand.java:194)
        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:3551)
        at android.os.Binder.shellCommand(Binder.java:956)
        at android.os.Binder.onTransact(Binder.java:840)
        at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:1144)
        at android.os.Binder.execTransactInternal(Binder.java:1190)
        at android.os.Binder.execTransact(Binder.java:1149)

解决思路

  1. 开启小米专属调试权限
    小米设备需额外开启USB调试(安全设置)(部分MIUI版本叫允许模拟位置),路径为:设置 -> 开发者选项 -> USB调试(安全设置),开启后允许ADB执行输入注入操作。

  2. 用root权限执行命令
    若设备已root,直接在命令前添加su提升权限:

    adb -s XXXXX shell su -c "input touchscreen swipe 126 459 913 472"
    
  3. 重新确认ADB连接权限
    断开ADB连接,执行adb kill-server和adb connect [设备IP],连接时确保设备弹窗选择允许调试并勾选始终允许此计算机。

  4. 调整命令写法
    去掉引号直接执行命令,或检查坐标是否在屏幕有效范围内:

    adb -s XXXXX shell input touchscreen swipe 126 459 913 472
    

内容的提问来源于stack exchange,提问作者shluvme

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 17:05:02