我无法将 app-debug.apk 安装到我的 phone

I can't able to install app-debug.apk into my phone

我在 JDK 1.8 或更高版本中使用了 cordova version@6,但我仍然可以 运行 我的 android 手机上的应用程序

我尝试run ionic Cordova run android 因此尝试删除并重新安装离子 Cordova 平台 android

BUILD SUCCESSFUL

Total time: 1 mins 18.416 secs
Built the following apk(s):
        E:/Aproject/Project file/thenationaltv app/mynationaltv/platforms/android/build/outputs/apk/android-debug.apk
> native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk
No hardare devices found, attempting emulator...
Selected emulator HKE839LB
Error: ENOENT: no such file or directory, open 'E:\Aproject\Project file\thenationaltv app\mynationaltv\platforms\android\app\build\outputs\apk\debug\app-debug.apk'
[ERROR] An error occurred while running subprocess native-run.

        native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

您的设备是否启用了开发模式?否则,您将无法设置 adb 连接或在 Play 商店外安装 APK。

启用开发模式的具体步骤可能因品牌而略有不同,但缩小范围如下:

  • 转到设置
  • 转到关于此 phone
  • 找到 Androir 内部版本号,然后点击它七次
  • 您将看到开发模式已启用的确认信息

有时您还需要进入开发者设置并启用 "Install APK outside the appstore" 和 "Enable USB Debugging"。

删除平台目录中的 android 文件夹。

  1. ionic cordova 平台添加 android
  2. ionic cordova 构建 android

然后 运行

ionic cordova run android --no-native-run