如何将我的cordova应用程序放置在android play商店中? [英] How do I put my cordova application on the android play store?

查看:90
本文介绍了如何将我的cordova应用程序放置在android play商店中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有关于此的官方cordova文档,我找不到它,希望提供一个链接.我已运行cordova run android部署到我的手机上.事情看起来不错.现在,我准备将其转换为官方应用程序,用户可以在android play store上下载该应用程序吗?当我构建我的应用程序时,它将生成一个名为"CordovaApp-debug.apk"的文件.该调试"部分使我认为这是使用错误的文件,但是我不确定如何生成正确的文件.

If there is official cordova documentation for this, I couldn't find it and would appreciate a link. I have run cordova run android to deploy to my phone. Things look good. Now I'm ready to turn this into an official app that users can download on the android play store? When I build my app it generates a file named "CordovaApp-debug.apk". That "debug" part makes me think this is the wrong file to work with, but I'm not sure how to generate the right file.

推荐答案

将混合应用程序部署到Google Play商店

Deploying a hybrid app to the Google Play Store

这些步骤适用于Cordova,PhoneGap或Ionic.唯一的区别是,对于您的特定情况,无论在何处调用cordova,都将其替换为phonegapionic.

These steps would work for Cordova, PhoneGap or Ionic. The only difference would be, wherever a call to cordova is placed, replace it with phonegap or ionic, for your particular scenario.

完成开发并准备部署后,请执行以下步骤:

Once you are done with the development and are ready to deploy, follow these steps:

  1. 打开命令行窗口(在macOS和Linux上为终端,在Windows上为Command Prompt).

  1. Open a command line window (Terminal on macOS and Linux OR Command Prompt on Windows).

转到/path/to/your/project/,我们将其称为项目根目录".

Head over to the /path/to/your/project/, which we would refer to as the Project Root.

在项目根目录中,从一组插件中删除"Console"插件.

命令是:cordova plugin rm cordova-plugin-console

While at the project root, remove the "Console" plugin from your set of plugins.

The command is: cordova plugin rm cordova-plugin-console

仍位于项目根目录时,请使用cordova build命令创建用于发行发行的APK.

命令是:cordova build --release android

While still at the project root, use the cordova build command to create an APK for release distribution.

The command is: cordova build --release android

上述过程在文件夹ProjectRoot/platforms/android/build/outputs/apk/

The above process creates a file called android-release-unsigned.apk in the folder ProjectRoot/platforms/android/build/outputs/apk/

使用 https://developer.android.com/studio/publish/app-signing.html#signing-manually

在此步骤结束时,您可以将获得的APK上传到Play商店.

Sign and align the APK using the instructions at https://developer.android.com/studio/publish/app-signing.html#signing-manually

At the end of this step the APK which you get can be uploaded to the Play Store.

注意:作为新手或初学者,最后一步可能会让我有些困惑.人们可能会遇到一些问题,并且可能对这些命令是什么以及在何处找到它们有疑问.

Note: As a newbie or a beginner, the last step may be a bit confusing as it was to me. One may run into a few issues and may have some questions as to what these commands are and where to find them.

问题1.什么是 jarsigner keytool ?
答案: Android App签名说明确实告诉您 jarsigner keytool 的全部含义,但并没有告诉您在哪里可以找到它们如果在命令行窗口中遇到找不到命令错误".

因此,如果您已经将Java开发工具包(JDK)添加到了 PATH 变量中,则只需按照《指南》中的命令运行即可.但是,如果您的PATH中没有它,则始终可以从JDK安装的 bin 文件夹中访问它们.

Q1. What are jarsigner and keytool?
Ans: The Android App Signing instructions do tell you specifically what jarsigner and keytool are all about BUT it doesn't tell you where to find them if you run into a 'command not found error' on the command line window.

Thus, if you've got the Java Development Kit(JDK) added to your PATH variable, simply running the commands as in the Guide would work. BUT, if you don't have it in your PATH, you can always access them from the bin folder of your JDK installation.

第二季度. zipalign 在哪里?
答案:很有可能找不到 zipalign 命令并收到找不到命令错误".您可能正在搜索 zipalign 以及在哪里找到它?

zipalign 实用程序位于Android SDK安装文件夹中.在macOS上,默认位置为user-name/Library/Android/sdk/.如果转到该文件夹​​,则会发现许多其他文件夹,例如docsplatform-toolsbuild-toolstoolsadd-ons ...

打开build-tools文件夹. cd build-tools.在这里,将有许多文件夹,这些文件夹根据您在Android SDK Manager中使用的构建工具链进行版本控制. ZipAlign 在每个文件夹中均可用.我个人选择了带有最新版本的文件夹.打开任何.

在macOS或Linux上,您可能必须使用./zipalign而不是像文档中提到的那样简单地输入zipalign.在Windows上,zipalign就足够了.

Q2. Where is zipalign?
Ans: There is a high probability to not find the zipalign command and receive the 'command not found error'. You'd probably be googling zipalign and where to find it?

The zipalign utility is present within the Android SDK installation folder. On macOS, the default location is at, user-name/Library/Android/sdk/. If you head over to the folder you would find a bunch of other folders like docs, platform-tools, build-tools, tools, add-ons...

Open the build-tools folder. cd build-tools. In here, there would be a number of folders which are versioned according to the build tool-chain you are using in the Android SDK Manager. ZipAlign is available in each of these folders. I personally go for the folder with the latest version on it. Open Any.

On macOS or Linux you may have to use ./zipalign rather than simply typing in zipalign as the documentation mentions. On Windows, zipalign is good enough.

这篇关于如何将我的cordova应用程序放置在android play商店中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆