Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode variables

In Xcode, I know that you can get variables such as PROJECT_DIR to use in some situations, such as a run script build phase. I am wondering if it's possible to get the build type (i.e., Release or Debug). Any ideas?

like image 887
Allyn Avatar asked May 20 '09 22:05

Allyn


People also ask

How do you add variables in Xcode?

Select your project or target from the left side of the editor. Click the Build Settings button at the top of the editor. Click the Add Build Setting button at the bottom of the editor and choose Add User-Defined Setting.

How do I see variables in Xcode?

See variable values in code and the variable viewer When your app pauses at a breakpoint, hover over a variable in your source code to view its current value. If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable.

How do I print a variable in Xcode?

Print a variableClick the Add Action button and select Debugger Command. Put any print command in a debug console in a text field. Make sure you prefix it with po , e.g., po print(view) . Check Automatically continue after evaluating actions.


2 Answers

The best source is probably Apple's official documentation. The specific variable you are looking for is CONFIGURATION.

like image 167
smorgan Avatar answered Oct 11 '22 03:10

smorgan


Here's a list of the environment variables. I think you might want CURRENT_VARIANT. See also BUILD_VARIANTS.

like image 23
Naaff Avatar answered Oct 11 '22 02:10

Naaff