PhoneGap Preliminary Interview!

Source: Internet
Author: User

Recently the company is preparing to develop a mobile app that is handy for developing Web projects, packaged with PhoneGap for iOS and Android platforms. I don't know about phonegap at all, so try it first. Tossing for the most of the day, finally make a few clues, tidy up for reference.

I. Environmental description

System: OS X Yosemite

Development environment: Xcode 6.4

Second, installation PhoneGap

1, first download installs the Node.js,node.js should use the 0.10.x version, above this version cannot install the phonegap.

2, in the console execution:

$sudo npm install -g phonegap

$sudo npm install -g cordova

Iii. Creation of the project

In console execution:

$ Cordova Create app Com.example.myapp mypp
"In this step, the project directory in the app, Com.example.myapp is bundle Identifile, and the last MyApp is the project name"
$ CD App
$ Cordova Platform Add iOS
This will create the iOS directory in app/platforms/and create the appropriate Xcode project in it, so you can use Xcode to open the project.

Run the project, normal! Thought it would be over if I got here! Try to change the index.html in the project, and then run, eh? No change! Try again, it's useless. In the project navigation to try to add a new folder and the page file, the index page to modify the new page, and finally a little change: Error:start page at ' test/index.html ' is not found. Finally figure out, it seems that the index.html page is not the project to start the actual use of the page. In the project Navigator to see the path of the index.html, is/app/www/index.html, and the actual project access is/app/platforms/ios/www/index.html, which I do not understand, clearly created by the iOS project, is in the/ app/platforms/ios/, why is the file listed in/app/www/when you open a project file using Xcode? Similarly, other files are the same, that is, I in the Xcode environment directly modify or add files, the actual will not be stored in the iOS directory, it seems a bit sad. This is how it is now, and then try to use the Xcode environment to develop the project in full.

Also, set the project index page in the APPDELEGATE.M file:

Self.viewController.wwwFolderName = @ "www";
Self.viewController.startPage = @ "index.html";

PhoneGap Preliminary Interview!

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: 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.