Re: How to copy final build after archiving to a less hidden directory (for frameworks and apps)
Re: How to copy final build after archiving to a less hidden directory (for frameworks and apps)
- Subject: Re: How to copy final build after archiving to a less hidden directory (for frameworks and apps)
- From: Alex Zavatone <email@hidden>
- Date: Fri, 23 Dec 2016 14:37:10 -0600
Add a Run Script Build Phase to use a shell script to the end of your build process
You'll also REALLY REALLY want to add a Run Script Build Phase as the second step in your Build Settings to simply execute "export" in the bash shell. This sill spit out all your build's environment variables and their values.
So you can see your target's destination and when when it's done, the last Run Script will do a cp of your target to where ever you want it to go.
Cool?
On Dec 23, 2016, at 2:24 PM, Andreas Falkenhahn wrote:
> So we all know that by default Xcode stores its builds in really, really
> hidden directories. For example, when archiving my framework it is stored
> in (*drumroll*):
>
> /Users/andreas/Library/Developer/Xcode/DerivedData/MyTestFramework-gcjvzcxbhhtkzigvxtfgzmkbcbbn/Build/Intermediates/ArchiveIntermediates/MyTestFramework/BuildProductsPath/Release-iphoneos/MyTestFramework.framework
>
> When building apps using such monster paths might not be a big problem
> because apps show up in Xcode's Organizer but frameworks don't.
>
> Anyway, I'd like to copy all my builds (apps and frameworks) to a central
> directory, e.g. to ~/MyBuilds or something like that.
>
> How can I do this please? I've tried to add a new "Run script" build
> phase which does something like this:
>
> PRODUCT="${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app"
> cp -R "${PRODUCT}" ~/MyBuilds
>
> This doesn't work correctly, however, because Xcode does several important
> build steps *after* running this script, i.e. stripping and codesigning
> is done *after* running the script. Hence, the app (or framework) copied
> to the new location with this script is incomplete.
>
> Any other ideas on how I can copy my apps and frameworks to a new location
> after archiving has completed?
>
> I know that I can change the DerivedData location in the project's setting
> but I don't want to do that because doing so will also store lots of
> intermediate stuff like object code in this location. I really only wish
> to have my final product (either an app or a framework) copied to a new
> location after archiving has finished. Nothing else, just the final
> product.
>
> How can I do this please?
>
> --
> Best regards,
> Andreas Falkenhahn mailto:email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden