錯誤日志如下:
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 adb: Command failed with exit code 1 Error output: adb: failed to install /Users/hongye0/Documents/project/haitoujiaApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user] [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.
解決辦法如下
因為編譯通過了,應該是手機問題,先關機重啟發現沒用,后來發現開發者模式下,需要打開 USB調試下面的“允許通過USB安裝”。
注:我是MI6,需要登陸小米賬號,必須查SMI卡,才能打開允許通過USB安裝