I am attempting to read a custom info.plist key's value into a User Defined Build Setting.
The 'APP_VERSION' is a macro defined in my INFOPLIST_PREPROCESSOR_DEFINITIONS file.
What I am trying to accomplish is getting macro definitions from my INFOPLIST_PREPROCESSOR_DEFINITIONS file into build settings based on different configurations.
I am going about this the wrong way? Or am I just missing something.
You can use the PlistBuddy
command in a 'Run Script Build Phase' to read and/or write values in your info.plist file.
To read:
/usr/libexec/PlistBuddy -c 'print PRX_APP_VERSION' Info.plist
To write:
/usr/libexec/PlistBuddy -c "Set :BUNDLE_DISPLAY_NAME NEW_VALUE" Info.plist
So in your Run Script Build Phase, read the value (or values) you want, store them into variables using standard shell scripting, modify as required, then write the values back to the new keys etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With