plist bundle version values
Asked Answered
Z

1

14

I want to set the Bundle Version in my plist. However, it appears that the value that is actually LOOKED at by finder to put the version when you look at more info is "bundle versions string, short" Editing this, however, requires opening the plist file, rather than just editing the "version" in the target settings.

Is there a way to either a) make the bundle version always equal the bundle version short, b) make finder look at the bundle version instead of the short string or c) make the short version appear in the edit target settings window?

Or, is there some better way I should be dealing with this?

thanks.

Zenas answered 23/11, 2009 at 16:18 Comment(0)
P
22

Yes, you can use ${VARIABLE} style macros the Info.plist file.

We make a user-defined setting in the project called APP_VERSION, and then use ${APP_VERSION} in the CFBundleGetInfoString (Get Info string), CFBundleShortVersionString (Bundle versions string, short) and CFBundleVersion (Bundle version) keys. At build time, the variable gets filled in with the correct version.

Watch out though because sometimes a clean build is necessary for Xcode to update the Info.plist file as it does not do dependency checking against the variables.

Plascencia answered 24/11, 2009 at 21:30 Comment(3)
How do you make such a setting, and how do you set it? I tried to use ${CFBundleVersion} to get the existing bundle version (which it DOES already know of course) but that didn't seem to work.Zenas
We use a user-defined setting. To make one, go to your project's Build settings and select "Add user-defined Setting" from the little pull-down menu in the bottom left. Name it APP_VERSION and set it to your version string. To use the variable, just use ${APP_VERSION} into the Info.plist.Plascencia
Thanks! Great answer, just what the doctor ordered :)Colotomy

© 2022 - 2024 — McMap. All rights reserved.