since i have an extension app inside my main App and my main app update the version and build according to the commit. I am wondering if is possible to update the extension version and build according to my main app automatically.
Asked
Active
Viewed 909 times
0
-
I have the same issue, seems no answer. :) – Steven Jun 19 '20 at 17:22
1 Answers
2
If you add a user defined variable at the project level to hold the shared number, you can then use this variable to set the version number or build number in each target in the solution.
The screen shots hopefully explain what I mean better ...

John Pollard
- 432
- 5
- 11
-
Thanks @John Pollard, the problem is in your first screen shot, you wrote SHARED_VERSION_NUMBER *4.1.2*, so instead of adding number how I can add the current variable. – Steven Jun 22 '20 at 12:44
-
Not sure I understand. You change the 4.1.2 to be whatever value you want it to be, and then you reuse that in your separate iOS, WatchOS etc. project so it’s the same across all your targets. You can’t automatically inherit it from the main project, you need a shared variable somewhere – John Pollard Jun 23 '20 at 05:39
-
Thank you @John Pollard, the problem is my bundle version string increment according to my commit automatically, so how can i pass that value instead of *4.1.2, i mean is there a way to pass the value of main app bundle version to SHARE_VERSION_NUMBER. – Steven Jun 23 '20 at 07:42
-
I don't think there is I'm afraid. What I do is use a script (you can find one by a Google search) is set that using the latest git commit count, and then run that build script in each target too – John Pollard Jun 23 '20 at 07:55
-
Thanks, i tried to use script but it gives error on xcode 11: https://stackoverflow.com/questions/62520154/update-cfbundleshortversionstring-with-script-gives-error-in-xcode-11 – Steven Jun 23 '20 at 08:32