Search code examples
iosinfo-plist

Setting UIPrerenderedIcon from a configuration file in Xcode


It seems I am not able to set UIPrerenderedIcon in my Info.plist, because it is ignored as of iPhone OS 2.1. You can't provide a String value of YES, this is no longer supported.

Is there any other way to do this without necessarly creating a separate Info.plist (e.g., using a pre–build run script)?


Solution

  • I figured this out. You will have to add a "Run Script" build phase, before "Compile Sources":

    #!/usr/bin/env sh

    set -o errexit set -o nounset

    /usr/libexec/PlistBuddy -c "Set UIPrerenderedIcon ${YOUR_CONFIG_KEY}" "${PROJECT_DIR}/*-Info.plist"