xcodexcconfig

How can I print to console from an xcconfig file?


I'm trying to debug some internal paths within xcconfig files, and I'd love to be able to echo/print/put the paths to see exactly where they're pointing.

Googling "What language is xcconfig?" doesn't give much besides that it's a text file (aren't they all?)

It's looks bash-ish, but echo doesn't work, neither does put or print or println.


Solution

  • You can see all environment and custom variables in any 'Run script' under 'Build Phases'.

    1. YourConfig.xcconfig:
    MY_VALUE = 11.0
    
    1. Then add 'Run Script' with 'Show environment variables in build log':

    enter image description here

    1. Build and look at your logs under 'Report Navigator':

    enter image description here

    1. Expand the log to see all variables:

    enter image description here