ionic 打包apk Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]


錯誤日志如下:

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安裝


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM