ionic- environment to build - Getting Started

Environment to build

1, the official recommendation:
npm install -g cordova Ionic
use npm domestic installation pits, download slowly, or fails

2, install CNPM, using Taobao mirror;:
NPM CNPM --registry the install -g = HTTPS: //registry.npm.taobao.org

3, and using CNPM installation cordova Ionic:
CNPM the install -g Ionic cordova

4、更新:
cnpm update -g cordova ionic

5, the update has been built ionic projects js library, the command line to enter the project directory, then run:
ionic lib Update

6, android configuration environment:
ANDROID_HOME = android_sdk you place the folder path
path =% ANDROID_HOME% \ Platform-Tools;
path =% ANDROID_HOME% \ Tools;

7、安装 Angular CLI:
cnpm install -g @angular/cli

8, when the package will use gradle:
Download:
http://services.gradle.org/distributions/
installation tutorial:
https://www.cnblogs.com/linkstar/p/7899191.html

getting Started

1. Create a project:
to enter the path you want to create a project, such as C: \ home \ ionic
create a project tabs in
the following format ionic start
Create a template project tab:
Ionic Start myApp tabs

2, add the android platform
cd into the project directory, execute the command:
Ionic cordova android the Add Platform

3, mounted reliance
cnpm i

3、生成android apk:
ionic cordova build android

4, or in the android simulator simulating real machine:
Ionic Cordova Emulate android

6, the above two steps can be combined into one step as
ionic cordova run android

7, the pit:
normal create a simple project blank, debugging on your phone, start the project has been black and white, index.html modify the project under src

<base href="/" />
改为:
<base href="." />

Guess you like

Origin www.cnblogs.com/zd-blogs/p/12015897.html