Xcode 4 build setting variables for scheme scripts

后端 未结 2 1756
孤独总比滥情好
孤独总比滥情好 2021-02-03 12:53

I\'m still getting used to Xcode 4, so forgive me if this is an asinine question:

In previous versions of Xcode, one could use any of the build setting variables (such a

相关标签:
2条回答
  • 2021-02-03 13:17

    In the "Run Script" scheme action in Xcode 4.2 there is a "Provide build settings from..." drop down menu where you can select a target from which you would like to have the environment variables from. See screenshot below:

    "Provide build settings from" drop down menu

    Apart from that, if you select "None", there will be a bunch of environment variables set by Xcode. You can discover all of them by doing something like printenv > ~/Desktop/printenv.txt to have them dumped to a text file.

    Some of the more useful environment variables include ARCHIVE_PATH, SCHEME_NAME, USER, ARCHIVE_DSYMS_PATH, ARCHIVE_PRODUCTS_PATH.

    0 讨论(0)
  • 2021-02-03 13:20

    You can still add a Run Script to a target in Xcode 4 in much the same way you could with Xcode 3. First select the project in the left hand project navigator pane and then with the target selected look in the Build Phases tab for the Run Script section. The scripts can use the usual set of variables as with Xcode 3.

    Reading some of the posts on this topic in the Apple developer forums it seems that Apple has at least acknowledged the limitations of the pre and post actions so we might see it fixed in a future update (open a bug report with Apple if you have not already done so).

    0 讨论(0)
提交回复
热议问题