从Xcode中的配置文件设置UIPrerenderedIcon

时间:2012-09-04 15:46:53

标签: ios info-plist

似乎我无法在UIPrerenderedIcon中设置Info.plist,因为it is ignored as of iPhone OS 2.1。您无法提供String YES的值,不再支持此功能。

有没有其他方法可以在不必创建单独的Info.plist的情况下执行此操作(例如,使用预构建运行脚本)?

2 个答案:

答案 0 :(得分:0)

我想出来了。您必须在“编译源代码”之前添加“运行脚本”构建阶段:

  

#!/ usr / bin / env sh

     

set -o errexit set -o nounset

     

/ usr / libexec / PlistBuddy -c“设置UIPrerenderedIcon $ {YOUR_CONFIG_KEY}”   “$ {PROJECT_DIR} / * - Info.plist中”<​​/ P>

答案 1 :(得分:0)

If you want to set value dynamically using command from shell script or terminal, you can do that as below:

/usr/libexec/PlistBuddy -c "Set :UIPrerenderedIcon YES" YOUR_PLIST_FILE_PATH

/usr/libexec/PlistBuddy -c "Set :CFBundleIcons:CFBundlePrimaryIcon:UIPrerenderedIcon YES" YOUR_PLIST_FILE_PATH