Search code examples
ioscordovaphonegap

Corodva serve command just reset the app erasing all my changes


I use the command cordova serve to test the app in browser. But when I issue the command, I find all the code changes I made to the app has been disappeared include newly added js files etc. The app just got a complete reset. How can I avoid this and still use cordova serve command to test in browser? Thanks.


Solution

  • I got the issue resolved. It took sometime to figure out what is happening under the hood. As I was making changes directly in platform IOS directory, the cordova prepare or serve statement just replaces the code from the parent www folder.

    To conclude, I have to make changes in root www folder and then issue the prepare/serve command that copies the code to the platform to test it out.