Alex Rivera | Logout

Add files to an Xcode project from a script?

Asked 2009-09-03T03:51:36.363
59

Right now I'm using a few scripts to generate files that I'm including as resources in Xcode. The thing is I'm running the script, then deleting from the project, then adding back into the project. There must be a way to automate this last step, so that the script can generate the files and automatically add them into the xcode project for me.

I'm using bash but any language examples would help.

Thanks, Andrew

Edit
Report

1 Answer

5

If you already have the files somewhere on your system, relative to your source root, you can always add a "Copy Files" phase. This will allow you to specify a directory where your resources should be copied from.

You can combine this with the Build Script phase answer provided to you already. For instance, run a script to check out your assets from Subversion into a subdirectory of your project, and then follow that up with a Copy Files phase that copies from "$(SRCROOT)/Assets".

answered 2010-03-05T05:14:05.733

Your Answer