xcode 4 + phonegap … not update JS upon build?

后端 未结 10 1030
误落风尘
误落风尘 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:17

    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 "...

    copy-www-build-step.sh is the script that copies the files over from www/ to where they go inside the app file. rsync is the unix file copying command they use. Without that -c, rsync just compares the file size on each file and folder and copies them over if the size has changed, and a couple of spaces or quotes don't count as enough of a change. With the -c, it checksums them and compares the checksums, which will catch even the smallest changes.

    I think this will work best, because it's not a workaround, it actually fixes the cause of the problem.

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

    I do not have mac right now, but few things to try:

    • Try to look at Your project build (or prebuild or something) action where www folder is supposed to be copied.

    • Try to change index.html and see if it works.

    • Try to copy paste all Your javascript code to index.html script tag

    • Try to validate Your javascript (For example: Google Closure Compiler) and see if it has no problems

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

    I'm not sure which did it, but I did the following:

    1. Changed an icon value in my MyProject-Info.plist
    2. Quit the simulator
    3. Product -> (hold option) -> Clean Build Folder
    4. Run
    0 讨论(0)
  • 2020-12-09 13:24

    Nothing solution of above work finally i saw there are two index.html file and .js file in the project created using Command line tool of Cordova

    So make changes as below shown under Staging folder

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

    I found it necessary to hold the Option button when clicking the menu command which turns the command from "Clean" to "Clean Build Folder..." and this caused my assets to be refreshed.

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

    Just add a new "Run Script" build phase to your target in XCode and paste this :

    touch -cm ${SRCROOT}/www
    
    0 讨论(0)
提交回复
热议问题