问题
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:
- 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
- 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