Xcode "Copy File Phase" in Projucer

Anyone knows how to add “Xcode copy file phase” to Projucer project?

I have a helper tool binary which needs to copied to specific location inside app package (“Contents/Library/LaunchServices/Resources”).

Any other possible approach to acomplish that?

Thx!

Polite bump :slight_smile:

Thx!

Hi. Have you tried placing the copy command into a “Post-Build Shell Script”?

I did. It works but it also breaks app signature, because app is automatically signed during build process in Xcode. The viable solution would be to skip Xcode signing during build and do it manually after (i guess also using “Post-Build Shell Script” command).

Neverthess, i wonder if there is any other, more elegant solution.

Ah yes, code signing.

At our company we already handle app signing outside of Xcode, so I didn’t think about that when I made my response.

It will be interesting if somebody else has a cool suggestion.

1 Like

I’ve made wrong assumption (and obviously my test was flawed as well) that Xcode is executing post-build script AFTER signing. The fact is, that signing happens at the very end, so signature is not broken, when helper tool files are copied into package using my custom post-build script.

I don’t know if it can be helpful for your case, but you can somehow control at what point the post build script is executed, by adding items as Input Files.

I the image below, I’m specifying that the Info.plist file (via macros that resolve to its path) is an input (a prerequisite) to the post build script, and that will ensure that the script is only executed after the Info.plist is generated by the build process.

(Yes, I had to do that because sometimes the post build script was executed before the Info.plist was updated for the current build)

1 Like

This is very interesting info, thx!

I like to have everything defined within Projucer project. I think additional scripts can not be defined there (?), except pre/post-build scripts, which fortunately solved my problem.