function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Josip Juric87Josip Juric87 

XCode development - Mobile SDK

I'm developing a hybrid (local) app in XCode. It has been setup with the forceios command line.
In XCode there are 2 www-folders - 1) At the top level, 2) in the Staging folder. When I change something in the 1), it is not displayed in the resulting app, until I run "cordova prepare" in the command line. This command line migrates the changes to the Staging folder. On the other hand, if I try to change the Staging folder, it asks me to unlock the file.
What is the correct way of development in this case? Do I need to run the cordova prepare line before every test-run?
Best Answer chosen by Josip Juric87
Gaurav KheterpalGaurav Kheterpal
This behavior was actually introduced in Cordova 3.4  and I agree it can be a bit confusing at first. The right way to do it is to run this command
 
cordova build
and then execute your project from XCode.  In reality, The folder:
my_cordova_project/platforms/ios/www/

is "mapped" in Xcode to
 
/my_xcode_project/staging/www/
The problem though is that Xcode's build for running command does not copy all/my_xcode_project/www/ into /my_xcode_project/staging/www/. This is done only by the cordova build command.

I hope this clarifies.

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker