Is there a way of automatically writing custom values to the bundle's .plist during a build phase?
I’m setting up a CI system using Jenkins and am using agvtool to bump and set marketing & technical versions at build time.
In addition to setting the versioning at build time it would be very useful to set a couple of of custom values in the .plist.
Is this possible?
Solutions Collect From Internet About “Is there a way of automatically writing custom values to the bundle's .plist during a build phase?”
You can edit the Info.plist at build time by taking advantage of the “Pre-actions” options to run a script.
Here’s an example script that increments a Key in the Plist called UserDefinedVersionNumber
#!/bin/sh #Grabs info from plist plist=$SRCROOT"/"$INFOPLIST_FILE currentBuild=`/usr/libexec/PlistBuddy -c "Print :UserDefinedVersionNumber" "$plist"` #And changes it before writing out the plist again if [ -z "$currentBuild" ] then currentBuild=1 /usr/libexec/PlistBuddy -c "Add :UserDefinedVersionNumber string $currentBuild" "$plist" else currentBuild=$(($currentBuild + 1)); /usr/libexec/PlistBuddy -c "Set :UserDefinedVersionNumber $currentBuild" "$plist" fi
You should be able to type the script directly into that little box, but I find that editing and maintaining it can become troublesome, especially for shared scripts.
- Receiver has no segue with identifier execption
- UIWebView + Sharepoint + NTLM Auth – I get Stream is sending an event before being opened
- how to give dynamic height to UIlabel programatically in swift?
- Firebase observe with type .childAdded retrieves all my information every time. Please assist
- Type 'String.Index' does not conform protocol 'IntegerLiteralConvertible'
- Objective C: How can you rotate text for UIButton and UILabel?
- Waiting for Asynchronous function call to complete
- How to create a button programmatically?
- Updating new version to app store with different sqlite db structure
- Swift. Playing fine mp3 file on simulator, but no volume while playing on device. AVPlayer
- How can I have a single tap to select text in WKWebView
- Expected Declaration Error using Swift
- Realm – module file was created by an older version of compiler
- UITableCell AccessoryView: Setting accessoryView equal to UIImageView infinite loop
- 'No such module' when I use CocoaPods