Finally... after a couple years of watching and a month of participating, I have a chance to ask you guys a question of my own.
My boss doesn't trust me (or any process) to increment a build number, he also wants to have a build date & time baked into the app. I'd like to put this into the usual Info.plist file.
I found this related question:
Build information in iOS Application (date/time app was built)
and based on the answers there, I went into the Scheme Editor and added the script below to the "Post-Action" section of the Build phase:
infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
builddate=`date`
if [[ -n "$builddate" ]]; then
defaults write "${infoplist%.plist}" BuildDate "${builddate}"
fi
In XCode, my Scheme Editor window looks like this:
(source: myke at maniac.deathstar.org)
Unfortunately, BuildDate never gets written into Info.plist.
Changing "${builddate}" to "$builddate" doesn't work either. I added this line to the script:
echo "build date is $builddate" > /tmp/result.txt
and the date appeared perfectly fine in the written out file. Writing strings into the Info.plist file from the above script works perfectly fine, annoyingly enough.
So, summed up, how to get the date to be added to the Info.plist file?