7

I wish to set the extension Bundle identifier by script according to its parent App. (So I can reuse the extension without duplicating the extension target.

right now the extension is hardcoded to this -

com.XXXXXX.FirstTargetName.QOD-Notification-Extention

I wish to create a script that will run when building the extension and set the bundle identifier dynamically to other target names.

Is there any environment variable that I can reach to get the parent app target name.

Thanks

shannoga
  • 19,649
  • 20
  • 104
  • 169

1 Answers1

1

Short answer: No (not till Xcode 12, but maybe they add one in newer Xcode versions?!).
See also: How to load prefix set by parent project?


Longer answer: Having the same issue, I looked at all the environment variables available to a script which I'm trying to use. I did not find the parent target's name or anything that provided a clue to the parent's name in those variables. I'm hoping I missed something.

To get a full list of environment variables I looked at the excellent suggestions here: How do I print a list of “Build Settings” in Xcode project?

but ultimately I used the suggestion here: Running Bash Script on XCode Compile — Where To Get List of Build Variables?

Top-Master
  • 7,611
  • 5
  • 39
  • 71
Tony Adams
  • 691
  • 1
  • 9
  • 29