How to make apk file using ionic framework with an

2019-03-11 08:31发布

I have created simple apps in local directory, that app name is Ionic-Chat-master

How can i make this to apk file?

i have tried the following command using git but not worked for me

npm install -g cordova

cordova build --release android

This displays an error (sh.exe": cordova: command not found).

标签: cordova ionic
7条回答
Luminary・发光体
2楼-- · 2019-03-11 09:01

for ionic 3 add ionic login enter email and pwd then

ionic package build android

please login and check the apk file.

查看更多
Juvenile、少年°
3楼-- · 2019-03-11 09:10
ionic platform add android
ionic build --release android
查看更多
冷血范
4楼-- · 2019-03-11 09:14

The easiest way, no need to install anything:

ionic package build android

(magic happens in the cloud)

Then you can download .apk to a computer or your Android device.

查看更多
Luminary・发光体
5楼-- · 2019-03-11 09:16

First of all you have to install

  1. node.js
  2. apache ANT
  3. Java JDK & JRE
  4. Android SDk & Eclipse

and then after all installation you have to set this all software path into environmental- variable. and then fire your npm install -g cordova. without this all software installation and there path setup your phoneGap application will not created. and still you have any confusion and any question related software installation and there path setup then again tell me i will help you.

查看更多
甜甜的少女心
6楼-- · 2019-03-11 09:17

If you want generate .apk using Ionic FrameWork . thats very simple for the sake of this discussion I created the sample app and convert that sample app in to .apk using Ionic Command.

1.Create a Ionic Sample App,

$ionic start Ionic-Chat-master

2.Adding a platform to that project

for ios

C:\Ionic-Chat-master>ionic platform add ios

and for android

C:\Ionic-Chat-master>ionic platform add android

3.Previewing on a mobile device(Be Sure your device is Connected)

for ios

C:\Ionic-Chat-master>ionic run ios -l –c

for android

C:\Ionic-Chat-master>ionic run android -l –c

4.Deploy to an android device

C:\Ionic-Chat-master>ionic build android

These are the Commands which leads to achieve a .apk .

查看更多
冷血范
7楼-- · 2019-03-11 09:17

We need to execute below mentioned steps to generate .apk with gradle build system:

Through out the steps I have assume that I am creating 'MyApp' project

Step 1 : generate myapp.keystore file using below mentioned command :

keytool -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000

Step 2 : create ant.properties file with following details :

storeFile=myapp.keystore
storePassword=<<your keystore password>>
keyAlias=myapp
keyPassword=<<your keystore password>>

Step 3 : create gradle.properties file with the path to set ant.properties file :

cdvReleaseSigningPropertiesFile= <<path to ant.properties>>

Step 4 : Use last command as mentioned below :

ionic build android --release

Note : You must have set path for : java, adb, jarsigner, zipalign

Your generated apk will be in build folder.

查看更多
登录 后发表回答