4

我正在使用带有 Cordova 的 Android Studio 开发一个简单的应用程序。但是当我运行时,我遇到了这个错误:

(node:9856) UnhandledPromiseRejectionWarning: CordovaError: Failed to execute shell command "input,keyevent,82"" on device: Error: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 4294967177
    at D:\sandbox\platforms\android\cordova\lib\Adb.js:88:25
    at _rejected (D:\sandbox\platforms\android\cordova\node_modules\q\q.js:864:24)
    at D:\sandbox\platforms\android\cordova\node_modules\q\q.js:890:30
    at Promise.when (D:\sandbox\platforms\android\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (D:\sandbox\platforms\android\cordova\node_modules\q\q.js:808:41)
    at D:\sandbox\platforms\android\cordova\node_modules\q\q.js:624:44
    at runSingle (D:\sandbox\platforms\android\cordova\node_modules\q\q.js:137:13)
    at flush (D:\sandbox\platforms\android\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:9856) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9856) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我的设备是 Redmi 4A,我已经启用了 USB 调试和通过 USB 安装。

4

1 回答 1

5

使能够:

  1. USB调试
  2. 通过 USB 安装
  3. USB 调试(安全设置) <-- 这很重要
于 2018-11-07T09:19:01.337 回答