I am setting a variable in the terminal
export VAR=1.0.0
And I have to read it from ~/.bash_profile into the info.plist like for example:
<key>CFBundleShortVersionString</key>
<string>VAR</string>
So like this I can do automated builds. Is there a way how to read the variables?
In the info.plist
you reference the variable:
<key>CFBundleShortVersionString</key>
<string>$(VAR)</string>
Then when you build the project from the terminal you inject the value for the VAR:
xcodebuild build VAR=123 -project myProject.xcodeproj -target myTarget -sdk iphonesimulator
Or if the variable in set in the environment:
xcodebuild build VAR=${VAR} -project myProject.xcodeproj -target myTarget -sdk iphonesimulator
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