views:

830

answers:

1

Hello,

In XCode, how can I call a 'shell script' which is a PERL script that copies the .app and .dsym files to a different directory? I want to pass the name of the project and/or the project's root directory to the script. I want to have the script called every time I build in release and distribution modes but not in debug mode.

Thanx in Advance.

-isdi-

+1  A: 

Right-click on your target and choose Add->New Build Phase->New Run Script Build Phase.

Inside the "Script" text area, add:

if [ ${CONFIGURATION} != "Debug" ]
then
    /usr/bin/perl "${PROJECT_DIR}/myperlscript.pl" "${PRODUCT_NAME}" "${PROJECT_DIR}"
fi

Change the location and name of myperlscript.pl to be the location and name of your script.

Make sure to move the Run Script step to be after Link Binary With Libraries, since you're copying the built .app.

(Might also want to add the "perl" tag to the question)

Shaggy Frog
Cool. Thanx.I didn't tag it with a language because I'm guessing I can substitute the perl part of the command line to use php or python or whatever else.
ISDi