IOS Cordova Environment Setup

Source: Internet
Author: User

First what is Cordova, Cordova's former is Phonegap.

Cordova provides a set of device-related APIs that enable mobile apps to access native device features, such as cameras, microphones, and so on, with JavaScript.

OK, now we build Cordova Environment on Mac, the following steps

1. Install git:http://www.git-scm.com/
2. Install Nodejs:http://nodejs.org/(If you install an older version of NPM, you'll need to manually install it, but the latest version comes with it)

3. enter the terminal command line using NPM to install Cordova as follows:

$ sudo npm install-g Cordova

4. Go to the project directory you want to create, and then create the PHONEGAP project.

$ Cordova Create Hello Com.example.hello HelloWorld

After entering this command, the Cordova program will help you create the Hello folder, which is the PHONEGAP environment.

5. Create the Xcode project file. To compile the app is definitely to use Xcode, do not install to go to the App store download it.

$ CD hello$ Cordova Platform add iOS

Then you use the Finder to go to the subdirectory and you will see the iOS folder in platforms, then you can run the project compilation.

6. The environment is there, but you have to do the project also need to call a lot of system things, such as camera, system information, file operation, etc., or third-party development of plug-ins. Crossing Web Documentation:

Basic device information (device API): (Equipment information plugin)

$ Cordova Plugin Add Org.apache.cordova.device

Network Connection and Battery Events: (Web Connection plugin)

$ Cordova Plugin Add org.apache.cordova.network-information$ Cordova plugin add org.apache.cordova.battery-status

Accelerometer, Compass, and geolocation: (gyroscope)

$ Cordova Plugin Add org.apache.cordova.device-motion$ Cordova plugin add org.apache.cordova.device-orientation$ Cordova Plugin Add org.apache.cordova.geolocation

Camera, Media Playback and Capture: (Camera photo recording, etc.)

$ Cordova Plugin Add org.apache.cordova.camera$ Cordova plugin add org.apache.cordova.media-capture$ Cordova plugin Add or G.apache.cordova.media

Access files on device or network (file API):

$ Cordova Plugin Add org.apache.cordova.file$ Cordova plugin add Org.apache.cordova.file-transfer

Notification via dialog box or vibration: (reminder)

$ Cordova Plugin Add org.apache.cordova.dialogs$ Cordova plugin add org.apache.cordova.vibration

Contacts: (Contact person)

$ Cordova Plugin Add org.apache.cordova.contacts

Globalization:

$ Cordova Plugin Add org.apache.cordova.globalization

SplashScreen:

$ Cordova Plugin Add Org.apache.cordova.splashscreen

Open new browser windows (Inappbrowser):

$ Cordova Plugin Add Org.apache.cordova.inappbrowser

Debug Console:

$ Cordova Plugin Add Org.apache.cordova.console


The above is the whole process of building Cordova environment on Mac

IOS Cordova Environment Setup

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.