Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there environment variable for Extension parent app target name

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

like image 966
shannoga Avatar asked Sep 01 '16 07:09

shannoga


People also ask

How would you find out Environment Variables for a program?

To list all the environment variables, use the command " env " (or " printenv "). You could also use " set " to list all the variables, including all local variables.

How do you name Environment Variables?

Environment variable names used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore) from the characters defined in Portable Character Set and do not begin with a digit.

What are my Environment Variables?

Environment variables are user variables or Windows system variables that describe the environment in which apps run. They can tell your apps things like the name of the computer, the name of the user account, the current working directory, etc.

How do I get Environment Variables in .NET core?

Open project properties by right clicking on the project in the solution explorer and select Properties. This will open properties page. Click on Debug tab and you will see Environment Variables as shown below. You may change the value as per your need.


1 Answers

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?

like image 200
Tony Adams Avatar answered Oct 07 '22 01:10

Tony Adams