Ionic环境搭建
来源:互联网 发布:做微信推文用什么软件 编辑:程序博客网 时间:2024/05/15 22:11
stepts
npm install -g ionic@beta
Make sure you have NodeJS installed. Download the installer here or use your favorite package manager. It’s best to get the 5x version of node along with the 3x version of npm. This offers the best in stability and speed for building.
Once that’s done, create your first Ionic app:
ionic start cutePuppyPics --v2
To run your app, cd into the directory that was created and then run the ionic serve command:
$ cd cutePuppyPics$ ionic serve
You can play with it right in the browser!
Building to a Device
After you have Ionic installed, you can build your app to a physical device. If you don’t have a physical device on hand, you can still build to a device emulator. Check out the iOS simulator docs if you are on a Mac, or the Genymotion docs if you are looking to emulate an Android device. You will also need Cordova to run your app on a native device. To install Cordova, run:
$ sudo npm install -g cordova
Building for Android
To build for Android, you’ll need to add the Android platform module to Cordova:
$ ionic platform add android
Next, you’ll need to install the Android SDK. The Android SDK allows you to build compile to a target device running Android. Although the Android SDK comes with a stock emulator, Genymotion is recommended, since it’s much faster. Once installed, start an Android image and run:
$ ionic run android
Problems
problem1
As a common cause for Chinese programmers,the existence of GFW will make it hard for us to dowlad gradles
solutions:
- dowload specificed version gradle from Internet.
- paste it in somewhere likes myApp\platforms\android\gradle\gradle-2.2.1-all.zip
- change distributionUrl in myApp/platforms/android/cordova/lib/builders/GradleBuilder.js
from var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';tovar distributionUrl = 'distributionUrl=../gradle-2.2.1-all.zip';
references
ionic build android error when download gradle - Stack Overflow
problem2
ionic serve opened a blank page
solutions:
change your browse,firefox or chorme will be fine.
problem3
EveryTime I run ionic run android,the code will go back to the original and don’t change.
solutions:
there are three directory have page htmls
- app/
- www/
- android/
please edit code in app directory and it will work well.
- ionic 环境搭建
- ionic 环境搭建
- (一) Ionic 环境搭建
- ionic环境搭建
- ionic 开发环境搭建
- ionic mac 环境搭建
- ionic环境搭建
- cordova+Ionic环境搭建
- IONIC 环境搭建
- Ionic环境搭建
- Ionic环境搭建
- Ionic开发环境搭建
- ionic 项目环境搭建
- Ionic环境搭建
- Ionic 环境搭建
- ionic环境搭建
- ionic 环境搭建
- Ionic 环境搭建
- 使用class-dump导出其他应用头文件
- uboot中常用汇编指令汇总解析
- Redis 和 Memcache 的性能对比基础篇
- Codeforces-448【A数学函数ceil】【B思维】【D二分】
- HDU 1551 Cable master / UVALive 2452 Cable master(切电缆,二分)
- Ionic环境搭建
- Memcache的最佳实践方案
- laravel5数据库操作
- 什么东西只花十分钟,但是受益终身
- 认识Servlet
- tjut 4630
- MDK注释时用@使单词高亮
- BD___单例模式
- HDOJ-----4004二分