1. 程式人生 > >ionic打包apkFailed to execute shell command "input,keyevent,82"" on device: Error: adb: Command failed with exit code 137

ionic打包apkFailed to execute shell command "input,keyevent,82"" on device: Error: adb: Command failed with exit code 137

錯誤程式碼如下

BUILD SUCCESSFUL in 12s
46 actionable tasks: 1 executed, 45 up-to-date
Built the following apk(s): 
        /Users/hongye0/Documents/project/haitoujiaApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
ANDROID_HOME=/Users/hongye0/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
No target specified, deploying to device 
'1c311fa1'. none Skipping build... Built the following apk(s): /Users/hongye0/Documents/project/haitoujiaApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk Using apk: /Users/hongye0/Documents/project/haitoujiaApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk Package name: io.ionic.starter Failed to execute shell command
"input,keyevent,82"" on device: Error: adb: Command failed with exit code 137 [ERROR] An error occurred while running subprocess cordova. cordova run android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.

我的手機是MI6:

解決辦法:

在開發者模式下,設定USB除錯(安全設定),允許通過USB除錯修改許可權或模擬點選