Home > other >  Access one targets Plist from Another target
Access one targets Plist from Another target

Time:11-15

I am currently trying to unify my targets inside of my application. I have one codebase I build multiple versions of the app, all tailored to a different client using targets.

That said, I want to unify the build number and versions so when I write code and archive, all the apps are built with the same version/build numbers.

Can I have all the target plist files reference the main target plist for these numbers, so I do not have to go into each target and increment them?

Or should I have my appDelegate update its own target when archiving?

CodePudding user response:

From what I understand you have multiple targets under the same project, and you want all the app's that the targets build to have the same version (that you set in one place). It is not so easy to read them from one info.plist, but it is easy to have one build setting variable that all the info.plist use.

Simply go to the info.plist for each of the targets and replace the value of the version with a variable value e.g. ${APP_VERSION}: enter image description here

The go to the project's build settings and add a user defined value with that name: enter image description here

and give it the value of the version you want: enter image description here

Now the info.plist will have the version you set in one place(the APP_VERSION build setting), you can do the same for the other info.plist files so that all read the same value.

  • Related