2

I'm an absolute beginner with Cordova and was following this tutorial when I started experiencing my problem.

The tutorial is more aimed at building the project for android but I applied the same steps to create an ios build on my mac. danieloram CordovaProject $ cordova run ios

the default project builds and runs fine but whenever I edit either the index.html or cordova.js files in the ios directory of the platforms folder and run the above command (or cordova build ios), all my changes revert back to the default code.. This behaviour isn't mentioned anywhere that I can see in the linked tutorial.

Am I missing something really obvious?

I haven't been able to find anything online about any other users experiencing this issue.. so I'm inclined to think it is trivial.

Danoram
  • 8,132
  • 12
  • 51
  • 71
  • Can you try editing using Xcode and see using Xcode build instead of cordova build ? Did you try that out ? – Sankar Narayanan Oct 10 '16 at 13:06
  • Running the app in Xcode the files my code stays :D but the default cordova app screen shows no matter what changes I make.. However, looking through a folder called 'Staging' I found an index.html file there and when I edited that the app changed! Do I need to change a config file? – Danoram Oct 10 '16 at 13:19

1 Answers1

1

Seems I found my answer, and a quick one at that.

The tutorial did not explicitly state which index.html file I was to edit so I naturally assumed it was the file nested inside the platforms/ios directory.

These file however should not be edited as they are overwritten using the outermost index.html file in the myapp/www/ folder.

This SO answer sums it up perfectly with more detail.

Community
  • 1
  • 1
Danoram
  • 8,132
  • 12
  • 51
  • 71