Corvoda environment to configure iOS and problems encountered!

Source: Internet
Author: User

Video: http://www.tudou.com/programs/view/sPU71j0LGtE/
Tutorial: http://www.hangge.com/blog/cache/detail_1145.html

1, install node. JS:
: https://nodejs.org Note Download


Detection installation: NPM-V
niubangzhudemacbook-air-2:~ niubangzhu$ Npm-v
3.10.3

Version detection: niubangzhudemacbook-air-2:~ niubangzhu$ node-v
v6.3.0

2, installing the Cordova CLI
(1) sudo npm install-g Cordova
Detection installation: niubangzhudemacbook-air-2:~ niubangzhu$ cordova-v
6.2.0


To update Corvoda (2) (3)
(2) sudo npm update cordova-g
(3) Update platform
Cordova Platform update iOS

Three, create a simple Cordova project
1. Create a new folder first,
Terminal: CD file path

2. Create a project:
Cordova Create MYAPP (project name)

3.CD MyApp

4.cordova Platform Add iOS (iOS refers to the platform that can be Android)


Four. Run
Cordova emulate iOS--target iphone-6s

Four. Run
2, directory structure description
Can seeStagingThe folder below has awwwFolder and aconfig .File (the blue box callout).
In the Staging folder, there is also a WWW folder and a config. config file (highlighted in red box).

We usually have the following two scenarios when we develop them:
(1) If you are running in Xcode, use the HTML page below Staging. So we can remove the outside www folder and config. html from the project (the red box is labeled), and only edit it using the staging folder, but this is not recommended.
Because every time Cordova compile, or update the project, install the plug-in will re-overwrite the files in the red box to the various platform files (blue box labeled). At the same time, only edit the HTML page under the Single Platform project folder, also does not conform to write once, simultaneously compiles publishes the multi-platform application development idea.

(2) So generally I am the editor outside the (red box callout) in the WWW folder page, and then run the following command to rebuild the project, these pages will automatically overwrite the corresponding directory under each platform.
1
Cordova Build
(3) You can then compile the run in Xcode, or you can run the emulator directly in "terminal" by running the following command without Xcode:
1
Cordova emulate iOS
You can specify the analog devices used by the simulator:
1
2
Cordova emulate iOS--target iphone-6s
Cordova emulate iOS--target Iphone-6s-plus

3, the result of the operation is as follows
(Configuration, development of the first application)

-----------------------------------------------------problems encountered and solutions---------------------------------------------------------- ----

Error:EACCES:permission denied, open '/users/niubangzhu/.config/configstore/insight-cordova.json '




Solution: Find the path to delete and rerun Cordova
Workaround:
Open Directory/users/hqtech/.config/configstore/, in Terminal input command: open/users/hqtech/.config/configstore/
Delete the Update-notifier-cordova.json file, and then run the Cordova command without an error.

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

1.NPM the specified version http://www.myext.cn/javascript/a_7300.html
-G is a global installation, if you want to install the specified version you can use sudo npm install-g [email protected] version number.

2.cordova the specified version http://zhidao.baidu.com/link?url=0rRIf22v7WKpzQ74PyZbXdv_ Lipchfphaigtvvim4juev1rro068i9yvllnfelnmpmsemj0f06wddfasmnrzpw-74k-ee8qpyxhvwdagwym

NPM install-g [email protected] To specify the Cordova version to install


Encountered Error:cannot find module ' xxxx ' errors such as
sudo npm install-g xxxx

Corvoda environment to configure iOS and problems encountered!

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.