typescript Ionic 应用程序未安装在 Android 设备中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43131774/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ionic App not installing in android device
提问by Suraj Jeswara
I am a newbie in Ionic. I just made a simple app in Ionic that ran well on browser. So, I converted it into an .apk file using Android studios that generated an android-release-unsigned.apk file. I transfered it to my device and on trying to install it I encountered that it was not being installed. I am not able to figure out the cause. Need some assistance.
我是 Ionic 的新手。我刚刚在 Ionic 中做了一个简单的应用程序,在浏览器上运行良好。因此,我使用生成 android-release-unsigned.apk 文件的 Android 工作室将其转换为 .apk 文件。我将它传输到我的设备,并在尝试安装它时遇到它没有被安装。我无法弄清楚原因。需要一些帮助。
回答by Sampath
You can follow the steps which are mentioned in the official doc below.
您可以按照下面官方文档中提到的步骤进行操作。
But for me, it didn't work.So I just manually did that as shown below.
但对我来说,它没有用。所以我只是手动做了,如下所示。
ionic cordova run android --device
Plugged device to the PC using USB
Copy the
android-debug.apk
file to the device (apk path:.. \platforms\android\build\outputs\apk)After that, You have to enable below setting on your Android device
ionic cordova run android --device
使用 USB 将设备插入 PC
将
android-debug.apk
文件复制到设备(apk路径:..\platforms\android\build\outputs\apk)之后,您必须在 Android 设备上启用以下设置
settings --> general tab --> security --> unknown sources (enabled this)
设置 --> 常规选项卡 --> 安全 --> 未知来源(启用此)
- After that just double-clicked the
android-debug.apk
from the location which you have copied.Then your app will be installed on your device.That is it.You can use your app on real device now.
- 之后只需双击
android-debug.apk
您复制的位置。然后您的应用程序将安装在您的设备上。就是这样。您现在可以在真实设备上使用您的应用程序。
回答by Korbin
The most probable reason I can think of is that your application is not signed. As Sampath mentioned try to build a debug version and not release version of your application and then install it on your device. You can can use 'ionic run android' and copy/paste manually the output android-debug.apk file to your device.
我能想到的最可能的原因是你的申请没有签名。正如 Sampath 提到的,尝试构建调试版本而不是发布应用程序的版本,然后将其安装在您的设备上。您可以使用“ionic run android”并将输出的 android-debug.apk 文件手动复制/粘贴到您的设备。
回答by Atiene Jonathan
- $ adb devices
- native-run android --app platform/your-app-debug-link.apk --device
- $ adb 设备
- 本机运行的 android --app 平台/your-app-debug-link.apk --device
回答by Koga
In the config.xml, in the 2nd line, there is a tag called widget. You have to give a unique id for that. If there is another ionic app installed with same widget id, your device will not allow you to install another app with the same id.
在 config.xml 的第 2 行中,有一个名为 widget 的标记。您必须为此提供一个唯一的 ID。如果安装了另一个具有相同小部件 ID 的 ionic 应用程序,您的设备将不允许您安装另一个具有相同 ID 的应用程序。