标签:
下载nodejs解压到opt目录
$ cd /usr/local/bin
$ sudo ln -s /opt/node-v5.1.0-linux-x64/bin/node
$ sudo ln -s /opt/node-v5.1.0-linux-x64/bin/npm
$ sudo npm install -g cordova ionic
下载android sdk解压到opt目录
$ vim .bashrc
export ANDROID_HOME="/opt/android-sdk-linux"
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
$ android
使用代理(http://mirrors.neusoft.edu.cn 80)下载Android SDK Tools,Android SDK platrform-tools,Android SDK Build-tools,API22
下载java
$ sudo apt-get install oracle-java8-installer
$ vim .bashrc
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
创建项目
1.空白应用
$ ionic start myApp blank
2.Tabs应用
$ ionic start myApp tabs
3.滑动菜单应用
$ ionic start myApp sidemenu
4.运行
$ cd myApp
$ ionic platform add android
$ ionic build android
$ ionic run android
$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios
$ ionic serve
有可能遇到的错误
Unrecognized VM option ‘MaxPermSize=256m‘
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
$ cd.gradle
$ vim gradle.properties
org.gradle.jvmargs=-Xmx512m
Execution failed for task ‘:validateDebugSigning‘.
> Unable to recreate missing debug keystore.
$ vim sudo chmod -R 777 .android
标签:
原文地址:http://www.cnblogs.com/legend-song/p/5357132.html