ionic开发环境搭建

330

1.安装node,并修改源为淘宝镜像源
node下载地址:http://nodejs.cn/download/
安装完成后,使用如下命令修改为淘宝镜像:
npm config set registry https://registry.npm.taobao.org

2.全局安装ionic、cordova
npm install -g ionic cordova

3.新建项目
ionic start myApp tabs
模板项目是从gihub拉取的,有时候会失败或者速度很慢,解决办法有两个:
1.番羽土啬
2.直接从github下载
tabs:https://github.com/ionic-team/ionic-starter-tabs
blank:https://github.com/ionic-team/ionic-starter-blank

4.运行项目
ionic serve

5.添加android平台
ionic cordova platform add android
检查环境
cordova requirements
如果提示:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
cmd: Command failed with exit code 1 Error output:
‘avdmanager’ �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
Gradle: installed C:\gradle-3.3\bin\gradle
说明已经安装好了,Android target不用管

6.安装android相关环境
android sdk(这个得番羽土啬)
jdk
gradle

7.编译打包app
ionic cordova build android

————————————————————
ios打包从6开始不一样(待写)
6.添加ios平台
ionic cordova platform add ios
7.安装xcode
8.生成xcode项目,并使用xcode打开
ionic cordova build ios
9.选择证书,并编译

留下一个答复

Please enter your comment!
Please enter your name here