I'm trying to add a value to my Info.plist
inside a Build Phase Run Script:
/usr/libexec/PlistBuddy -c "Add :BuildDate date `date`" "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
# For debugging:
cat "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" | grep BuildDate
This works (as proven by the cat
), but it seems the result is almost immediately overwritten afterwards, by some other Xcode build step.
Is it simply not possible to modify the Info.plist
in the Build Phase? I've seen numerous suggestions around the web to do exactly that.
${TARGET_BUILD_DIR}/${INFOPLIST_PATH}
; like the above, I can see it added to the plist in the compiled app, but just prior to the build completing, the new entry disappears. – Property