Phonegap / Cordova - Build Apk

我们两清 提交于 2019-12-31 03:18:08

问题


Does anyone know how to generate the apk?

I'm trying to build the apk of my application with Phonegap / Cordova CLI. I need some tutorials or information about it.


回答1:


To check whether or not you have everything installed that is required to build an APK first run this command:

$ cordova requirements

This should give something similar to the following result:

Requirements check results for android:
Java JDK: installed .
Android SDK: installed
Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23
Gradle: installed

You need to make sure that you have the latest Java JDK installed and the Android SDK. You will also need to make sure that Java is in you computer's PATH.

Then you can run this command:

$ cordova build android

Follow this guide:

https://cordova.apache.org/docs/en/latest/guide/cli/




回答2:


Build your android cordova project from Command line:

cordova build android

After successfully run the above command you can see the apk file in following path of your project under platform folder : 'Your project folder'\platforms\android\build\outputs\apk




回答3:


I assume that you are using Cordova CLI, run the following command from project root directory:

cordova prepare
cordova build android

follow this tutorial: https://cordova.apache.org/docs/en/latest/guide/cli/




回答4:


There are two ways to build apk, check below:

  1. You can generate build from https://build.phonegap.com

For this you have to login into phonegap site and upload your www folder, it will create apk for you automatically

  1. From command line also you can build using following command
phonegap build android

OR

cordova build android


来源:https://stackoverflow.com/questions/43452084/phonegap-cordova-build-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!