Cordova + ionic 开发环境搭建
一、ionic 1.x 安装与配置
1.ionic环境安装
npm install -g cordova ionic
ionic -v
cordova -v
2.创建ionic项目和服务器
ionic start myApp tabs/sidemenu/blank
ionic serve
3.运行创建的ionic项目
a. 进入到ionic项目文件夹
cd myApp
b. 在ionic上添加 android 平台
ionic platform add android
c. 生成 android apk
ionic build android
d. 在 android 模拟器或者真机上模拟
ionic emulate android
e. c/d 两步可以合并为:
ionic run android
二、android 开发环境搭建
1、下载并安装配置JDK的变量环境
下载地址:oracle官网 http://www.oracle.com/technetwork/java/javase/downloads/index.html
环境配置:
JAVA_HOME : 变量值为JDK在你电脑上的安装路径
比如:C:Program FilesJavajdk1.8.0_20
CLASSPATH :
变量值为:.;%JAVA_HOME%libdt.jar;%JAVA_HOME%lib ools.jar
Path:
变量值为在原属性后追加:;%JAVA_HOME%in;%JAVA_HOME%jrein
检查JDK是否安上,环境是否配置好:
java -v
javac -v
2、apache-ant 打包部署工具下载并安装配置环境
环境配置:
ANT_HOME:变量值为ant在你电脑上的安装路径
D:Program Files (x86)apache-ant-1.9.7
path:
变量值为在原属性后追加:;%ANT_HOME%in
检查ant是否安上,环境是否配置好:
ant -version
3、下载安装ADT-Bundle 最新集成开发环境
(已经包含Eclipse, ADT, SDK Tools,其中ADT已经绑定到Eclipse上了)
下载地址:
http://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip
http://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip环境配置:
ANDROID_HOME:变量值为sdk在你电脑上的安装路径
D:adt-bundle-windows-x86-20140702sdk
path :
变量值为在原属性后追加:;%ANDROID_HOME%platform-tools;%ANDROID_HOME% ools
检查安卓环境是否配置好:
adb