`adb shell input` returns `Killed` 响应没有注册任何输入

`adb shell input` returns `Killed` response without any input registered

我正在尝试在我的小米 Mi Max 2 上模拟触摸。我尝试了 monkeyrunner 但失败了,所以我正在尝试 adb。但是,每个命令都由 Killed 响应返回,并且没有按下 touch/key。这是什么意思?

在执行该命令之前,您需要对 android 设备进行 root 操作。很少有 adb 命令需要 root 权限

我的小米 max 3 成功了

PS D:\ADB Command> adb devices
List of devices attached
606704bf        device
MKJ0117A19000186        device

PS D:\ADB Command> adb -s 606704bf shell
nitrogen:/ $ input keyevent MENU
nitrogen:/ $ input keyevent MENU
nitrogen:/ $

我曾经在小米设备上使用我们用于开发的 MIUI 来获取它。

当使用 adb 发送 input 命令时,我看不到任何输出并且 adb 命令以 SIGEXIT 完成。

当我尝试在 adb shell(在设备上)中手动发出它时,我会看到 killed 输出。

通过在 Developer options 中启用 USB debugging (Security setting) 解决(请注意,这 不是标准 USB debugging 设置,它已经启用) .这需要一些确认步骤,一旦启用,input 命令就起作用了。