Skipping the 'CompressResources' build step for Xcode iPhone apps

后端 未结 5 769
遥遥无期
遥遥无期 2020-12-30 09:03

Is it possible to set an iPhone Xcode project to skip the \'CompressResources\' build step?

Specifically, I want to skip the stage where it runs pngcrush on all of m

相关标签:
5条回答
  • 2020-12-30 09:11

    The iphoneos-optimize script converts PNG files into a nonstandard format that is optimized for display on the iPhone. The script will convert any files with the png extension that it finds inside your app bundle.

    I had a similar problem, and solved it by giving my file the extension _png (i.e., prefixed an underscore). iphoneos-optimize ignored it and left it a regular PNG file. If you can deal with it that way, it's probably a lot safer than mucking about with the build scripts.

    0 讨论(0)
  • 2020-12-30 09:16

    You can add "IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs" to your project settings to prevent the png mangling, but be careful with it, you might need to optimize the icon and Default.png separately then.

    0 讨论(0)
  • 2020-12-30 09:17

    That might be another issue all together. In many cases the problem has to do with naming and can be solved very easily.

    read this: http://cocoapi.wordpress.com/2009/03/22/iphone-images-not-appearing-in-real-iphone-this-is-why/

    0 讨论(0)
  • 2020-12-30 09:26
    • Open build settings
    • Under "packaging" choose Compress PNG files
    • Choose "NO"
    0 讨论(0)
  • 2020-12-30 09:29

    If you look at the build output you'll see that the CompressResources step runs the script /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/iphoneos-optimize. This appears to be just a shell script that runs pngcrush and compiles plists into binary format. You could probably modify this script to not run pngcrush.

    Note that someone in this thread noticed that if they did not run their icon file through pngcrush it wasn't showing up on the phone.

    Interestingly, the version of pngcrush in the directory of the script has a -iphone argument. Anybody know if this is standard or something Apple just ships with their build of it?

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