如何使用离子框架与角度的apk文件 [英] How to make apk file using ionic framework with angular

查看:116
本文介绍了如何使用离子框架与角度的apk文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地目录中创建了简单的应用程序,该应用程序名称是Ionic-Chat-master



如何将此文件设为apk文件?



我使用git尝试了下面的命令但是没有为我工作

  g cordova 

cordova build --release android

这会显示错误 sh.exe:cordova:command not found

解决方案

如果你想使用Ionic FrameWork生成.apk,这很简单,为了讨论,我创建了示例应用程序,并使用 Ionic Command 将该示例应用程序转换为.apk。



创建Ionic示例应用程序。

  $ ionic start Ionic-Chat-master 

添加平台到该项目



b
$ b

  C:\Ionic-Chat-master>离子平台add ios 

android

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

/ p>

  C:\Ionic-Chat-master>离子运行ios -l -c 

$>



<$ p $ <$ p $ <$>

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

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

这些是可以实现 .apk


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).

解决方案

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 .

这篇关于如何使用离子框架与角度的apk文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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