Question

I have a single Xcode project with multiple targets.

Each target has its own Info.plist file with the version number of that application. (CFBundleVersion and CFBundleShortVersionString)

How can I use single, common Version Number and Build Number source for each target, rather than editing each target's plist file?

Was it helpful?

Solution 2

Add a new custom property to your project (Editor -> Add Build Setting -> Add User Defined Setting). Let's name it MY_VERSION and let's give it value 1.0.1.

Now go to the Info section of every target and set the version to ${MY_VERSION}.

OTHER TIPS

The following works with Xcode 12 and does not require User-Defined variables.

  1. Select your project
  2. Select Build Settings and find "Versioning"
  3. Set "Marketing Version" to be your version
  4. Set "Current Project Version" to be your build

Update project


  1. Next, select each of your targets
  2. Delete/remove any version number and it will use the default "Marketing Version"
  3. Delete/remove any build number and it will use the default "Current Project Version"
  4. Do this for all of your targets

Update targets


Once you do this, you only need to update the "Marketing Version" and "Current Project Version" for the Project and all of your targets will be updated accordingly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top