xcode 4 + phonegap … not update JS upon build?

后端 未结 10 1031
误落风尘
误落风尘 2020-12-09 12:48

I\'ve run into a weird issue that has had me scratching my head for the past hour.

I\'m working on an iPad app using Xcode 4 and PhoneGap. It\'s using jQuery. I\'ve

相关标签:
10条回答
  • 2020-12-09 13:32

    I just had this issue, and the build phase command posted here (which is actually now used by the default Phonegap project) did not work for me, since I am editing my files on a Parallels Windows VM, in Visual Studio.

    What I did, was use this instead, in the Build Phase of my project:

    find "${PROJECT_DIR}/www/." -exec touch -cm {} \;
    

    Thats basically a recursive touch. I then set up Visual Studio to always reload the file, if it has been saved. Hope this helps.

    0 讨论(0)
  • 2020-12-09 13:33

    Well, after some more googling, this seems to be a common problem. Xcode seems to cache files even after you've edited them.

    One option appears to be to run the 'clean' command before a new build. I tried that, no luck.

    Other solutions appear to involve rebuilding the .plist file each time. I don't fully understand that (yet) in terms of how to do that automatically, but did find this workaround:

    • Open your .plist file
    • change something (in my case, I rename one of the app icon files each time)
    • save and build

    Doing that magically forces xcode to FINALLY grab all the updated files and do a proper build.

    I can't explain why Xcode seems perfectly happy grabbing my updated .css file each and every time but won't update the .html or or .js files without first doing this .plist file edit.

    Seems as if Apple still has a few bugs to work out. I guess we'll have to wait patiently for the next 4gig .x relase of it. ;)

    0 讨论(0)
  • 2020-12-09 13:33

    I had this same issue with the iOS Simulator, I tried most of the suggestions above with no success, it would not pick up my changes. Later another possible solution occurred to me, which did work:

    Delete the app from the simulator. (ie. Click and hold on the icon, then hit the X when it starts to shake, then Hardware Home) Then re-run from xCode.

    (NB: "cordova build ios" was also required)

    0 讨论(0)
  • 2020-12-09 13:41

    None of these worked for me :(

    The only way I can get the thing to update its html and js is by running a "corodova run ios" at the command line.

    0 讨论(0)
提交回复
热议问题