Apparently the file gets cached, so it only gets built when it gets changed. I have environment variables set to increment my version number though, and such, and update them independently of the plist (in the project build settings, actually). Is there a script that I can use as a script build phase that will force the Info.plist to update? Some other convenient way?
plist file. If you need to edit these items, Control-click (or right-click) Info. plist in the sidebar and select Edit Manually. This allows you to add or edit items in raw XML format.
Select 'Edit Scheme', then select 'Build' from the control on the left.
Then, add a Pre-actions step, ensure the scheme in question is selected in the 'Provide build settings from' pulldown and then add this into the edit window below:
rm "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}"
This will delete the cached version of Info.plist
, causing XCode to rebuild it each time you hit build.
Alternatively, if you let Xcode preprocess a template Info.plist file, simply touching the template with
touch ${PROJECT_DIR}/${INFOPLIST_FILE}
works too.
Debugging pre-action scripts
The pre-actions steps do not provide any information when you have made a mistake. You can debug the use of your build variables by adding this line to the script
echo "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}" > ~/debug.txt
Then check the content of ~/debug.txt
to verify that the pre-action script has run and to see if you've used the correct path.
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