Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the need of staging folder in Cordova 3.5.0 iOS application?

We are working on a hybrid iOS application. Previously we were using Cordova 3.2.0 version. Recently we are under the process of upgrading our Cordova version to 3.5.0. After creating a new project with Cordova 3.5.0 and opening it with Xcode 5.1.1, we can see a new folder named "Staging" in the Xcode project structure (it's pretty strange for us).

In the root folder of project, there is no staging folder found. Below is the screenshot.

enter image description here

But after opening it with Xcode, the "www" folder and the "config.xml" are coming under staging directory instead of the root directory. Also, I can see two sets of www folder and config.xml file. The www folder & config.xml file which comes under root folder appears in red color (that may be because I have taken only the my_cordova_project --> platform --> ios directory and copied it to some other place. I am planning to commit only the ios folder to my versioning tool). I have simply deleted those two references.

enter image description hereenter image description here

Could someone please explain me if this is an issue. Can I get the old Xcode project structure with Cordova 3.5.0 also? Please let me know in case of any clarifications.

like image 710
Rashmi Ranjan mallick Avatar asked Aug 25 '14 14:08

Rashmi Ranjan mallick


2 Answers

I had the same problem understanding the relation of /www and /platforms/ios/www. I realized the former should contain the source common to all platforms and the latter should hold platform specific modifications. The Staging folder appearing in the Xcode project is a link to the latter folder. Modifying the content on the former folder and running the app seemed to have no effect - no modifications were seen.

The thing I was missing was that after the modifications I would still need to do the build on command line:

cordova build ios

After that the modifications in the common folder are copied to the platform specific folder(s) and running the project in Xcode shows the modified content.

like image 155
james0n Avatar answered Oct 10 '22 20:10

james0n


Sorry, I did not understand your question. Staging is simply a link folder to the ios-proj/www folder, and you can edit your code normally modifying the original.

In a multi-platform project "cordova platform add " will create a different project for each platform, in this case your editing should be done in the common code and sync sources through "cordova build" that will copy and compile code.

A similar question about the staging purpose: Purpose of Staging folder in PhoneGap 3.4? Only changes to index.html in this folder get recognized? enter image description here

like image 33
malcubierre Avatar answered Oct 10 '22 20:10

malcubierre