简体   繁体   中英

Cordova iOS App which is the right www folder?

I am trying to build a Cordova app. All is set up fine, but I am confused now.

There is a www folder in the main folder which is displayed in Xcode. But there is a second in platforms/iOS . This folder is used when I am building the app.

Is that the way it should work? Or can I tell Xcode to take the other folder and not the www in root?

THANKS!

EDIT: And where to locate config.xml ? Because in root the iOS App will not find any plugin eg EDIT2: Got that with plugins! Have to install them over terminal

Yes this is a way Cordova is working.

The www in the main folder is the place where you have to implement you changes if you willing to support more then one platform. That folder copied to the platforms/ios/www each time when you run cordova prepare ios and this is actual folder which will be bundled with you iOS application. You you made changes in you main www folder and forget to run cordova prepare ios then you would not see you changes in you application if you run it. You have to run cordova prepare after making changes in the www in the main folder of you app.

Note : If you using cordova build or cordova run then you don't need to call cordova prepare , these commands will call it internally during the run.

As of Cordova 3.5 folder www in the Xcode which you see is same folder which is located in you main appication folder, and folder Staging->www in XCode is folder pointing to platforms/ios/www folder created by cordova prepare for you.

Before Cordova 3.4, www folder in XCode was pointing to platforms/ios/www folder.

I would recommend you made changes in www subfolder of you main folder and run cordova prepare\\build\\run to build/run your application if you plan to mainly work with HTML + JS or your application would support more then one platform. Otherwise, if you app is strictly iOS you could made you changes directly in Staging->www inside XCode and test you changes immidiately

You could start reading about development path with Cordova here: http://cordova.apache.org/docs/en/3.5.0/guide_overview_index.md.html#Overview_development_paths

More information about using Cordova CLI is here: http://cordova.apache.org/docs/en/3.5.0/guide_cli_index.md.html#The%20Command-Line%20Interface for explanation of the workflow.

www folder in root level has html, javascript etc. When you build your code, same www folder for each platform will be created. So If you make any code changes in main www folder. You should rebuild the code for specific platform each time. Then only your changes in the main www will be applied in the platform specific www folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM