Installation configuration of cordova+ionic in MAC OSX environment

Source: Internet
Author: User

I. INTRODUCTION 1. What is Ionic?

IONIC is currently the most promising HTML5 mobile application development framework. Build your application with SASS, which provides a number of UI components to help developers develop powerful applications. It uses the JavaScript MVVM framework and AngularJS to enhance the application. Provides two-way binding of data, using it as a common choice for Web and mobile developers. Ionic is a development framework that focuses on web development technology, based on HTML5 to create a native app similar to a mobile platform. The purpose of the Ionic framework is to develop a mobile application from a Web perspective, based on the PhoneGap compiler platform, which can be compiled into various platform applications.

In HTML5 mobile app development, speed is very important. The ionic is excellent in the latest mobile devices and runs very smoothly. The least-manipulated DOM, non-jQuery, and hardware-accelerated transitions let you feel that apps developed with HTML5 can also fly.

What is 2.cordova?

Cordova predecessor is PhoneGap, mainly with its plug-in. Used to package HTML, CSS, and JavaScript into an app

What is 3.ngCordova?

Ngcordova is a series of open-source ANGULARJS services and extensions encapsulated on the Cordova API, enabling developers to easily invoke device capabilities in HYBRIDAPP development, i.e. access to device capability APIs in ANGULARJS code, such as access to files, Cameras, GPS, and so on, these plugins can be used in ionic only with simple configuration.

?

Ii. installation of Cordova and Ionic

1. Before installing ionic, make sure your Mac has Xcode installed, please refer to: Installation of Xcode integrated development environment

2. To install the Nodejs before installing Cordova, refer to: Installing node. js under Mac

3.git does not install, OSX and Linux have their own git, you can enter the command line git--version check

?

4. Install Cordova:
1> Because the mirror of the Cordova installation package is abroad, the domestic network does not work, and the installation failure occurs frequently. This will use the proxy and enter the command at the command line: "NPM config set registry http://registry.cnpmjs.org"

?

2>. Install Cordova: "sudo npm install-g Cordova" with root privileges, prompt for password after execution, enter your Mac boot password:

?

3>. Enter "Cordova-v" to verify the Cordova version:

?

5. Install Ionic:
1> Use the sudo npm install-g Ionic command to install the ionic:

?

2> Enter "Ionic-v" to verify the version:

?

3>. Enter "sudo npm install-g ios-sim" To install the iOS simulator:

In addition to the above, also install NPM install-g Ios-deploy, reported the following error

When using Cordova or ionic command lines,

NPM install-g Ios-deploy

or sudo npm install-g ios-deploy all error,

Such as:

NPM WARN Lifecycle [email protected]~preinstall:cannot run in WD%s%s (wd=%s) [email protected]./src/scripts/check_reqs . js && xcodebuild/usr/local/lib/node_modules/.staging/ios-deploy-298c9491
NPM err! Darwin 15.3.0
NPM err! argv "/usr/local/bin/node" "/USR/LOCAL/BIN/NPM" "Install" "-G" "Ios-deploy"
NPM err! Node v5.8.0
NPM err! NPM v3.7.3
NPM err! Path/usr/local/lib/node_modules/ios-deploy/build/release/ios-deploy
NPM err! Code ENOENT
NPM err! Errno-2
NPM err! Syscall chmod

NPM err! Enoent enoent:no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy/build/release/ios-deploy '
NPM err! Enoent enoent:no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy/build/release/ios-deploy '
NPM err! Enoent This is the most likely not a problem with NPM itself
NPM err! Enoent and is related to NPM, being able to find a file.
NPM err! Enoent

The problem solving method can be found in https://github.com/phonegap/ios-deploy/issues/188, which is actually:

sudo npm install-g ios-deploy--unsafe-perm=true

This time it gives a hint:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! Warning:you is on OS X 10.11 El Capitan, your may need to add the
!!!! WARNING: '--unsafe-perm=true ' flag when running ' NPM install '
!!!! Warning:or else it would fail.
!!!! Warning:link:
!!!! Warning:https://github.com/phonegap/ios-deploy#os-x-1011-el-capitan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

3.1 Project Generation

Terminal operation

Go to Desktop

CD./desktop

Build the Demo_1 File project

Ionic start Demo_1


If you create an ' IOS ' app, ' terminal ' runs:

CD Demo_1

Ionic Platform Add iOS (sudo may be required)

Ionic build iOS

Ionic emulate iOS//simulator run

The generated iOS app is displayed in the ' Platforms ' folder.



Wen/springer (author of Jane's book)
Original link: http://www.jianshu.com/p/7a7abfa9f435
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

Installation configuration of cordova+ionic in MAC OSX environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.