Ksliman Ksliman - 1 month ago 14
iOS Question

XCode Build not updating JS and HTML

I am using XCode 5.0.2 and Cordova 3.4.0-0.1.3 - What I find is after creating the project using the Cordova CLI and opening in XCode, no changes to the index.html file and index.js file are ever carried over to the simulator when I click run.
I have to open terminal and issues a Cordova Build command and then run the simulator and it works

I followed all the instructions here:

Phonegap - developing and launching app on simulator

xcode 4 + phonegap ... not update JS upon build?

And none of it works! any one a have a solution to this, because having to switch back and forth is becoming a pain.


So after much searching I seem to have found a solution that works, here is what I did. After looking at other Stackoverflow questions I found someone that said this worked for them.

Find the file called copy-www-build-step.sh.

Mine was in [project_folder]/platforms/ios/cordova/lib/copy-www-build-step.sh

In that file, find the lines beginning rsync -a "...

Add -c to the rsync lines, so they ready rsync -a -c "...

Well I tried that and it did not work on its own. I also tried the answer from Ville and that pulled closer but no cigar. Finally I took what the command from Ville and put it in the copy-www-build-step.sh file

so my top line is now

cd /path/to/your/cordova/project/
cordova prepare

IFS=$(echo -en "\n\b")
.....etc etc 

And now I make change , and click run , bam all is updated. I hope this helps someone else.