Quantcast
Channel: User trojanfoe - Stack Overflow
Viewing all articles
Browse latest Browse all 222

Answer by trojanfoe for Xcode - How to run script just before build starts

$
0
0

The best approach is to create pseudo target in your project.

For example, say you have a shell script that sets the app version by updating an .xcconfig file:

  • Create a target called SetAppVersion of type Other> External Build System.
  • Leave the Build Tool at /bin/bash, set the Arguments to whatever script does the work, for example scripts/set_app_version.sh and set the Directory to $(PROJECT_DIR).

Now for any target affected by this script, simply make the SetAppVersion target a dependency of it, and it will run before any other action is performed on those targets.


Viewing all articles
Browse latest Browse all 222

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>