Xcode 4 target build setting "Skip install". What is it?
Asked Answered
I

3

28

The tile basically says it all.

I'm developing a mac app which has the normal app target, but also has two more command-line tool targets whose products are copied to the app when building. I remember seeing somewhere that the "Skip install" was important in these cases, but I remember nothing of what I read, so this might be incorrect.

Anyway, I just wanted to know what this option affects.

Inclination answered 4/5, 2013 at 13:32 Comment(3)
I would argue 90% of Xcode's "Build Settings" are so poorly named that Apple's own engineers probably don't even know what they do! They are all so nebulous and idiotically phrased... I struggle with them dearly. I can't imagine the utter confusion non-english speakers must encounter trying to figure out what most of them mean!Kuska
@alexgray I agree... Admittedly, it could be worse, but not much more than it already is.Inclination
@alexgray In Xcode's defense, most of these were taken more or less directly from Unix and GCC. There the configure/make/make install incantation has a defined meaning that everybody is aware of. The issue is more that most things developed with Xcode are likely Mac GUI apps and as such a lot of this stuff can be misleading.Freighter
R
19

I believe this only matters when you're developing for the App Store. If you archive your app target and this includes building other targets (command line tools, static libraries, ...), all the targets' products are copied into the archive, unless SKIP_INSTALL is set to YES.

You can verify this: Archive your application, find the archive in the Organizer, Option-Click --> "Show in Finder", go into the archive (Option-Click --> "Show Package Contents"), and in /Products you will find multiple files/folders. However, App Store builds only allow one product within the Products directory. Xcode warns you about this if you "Validate" your archived app in the Organizer:

Skip Install not set for sub targets

Revelationist answered 5/5, 2013 at 10:18 Comment(2)
Thanks, I found out other sources that confirm this, and my own experience agrees as well. Since I'm developing for the MAS, this does matter.Inclination
It also matters when building an xcframework, where you "tell Xcode to install your framework in the resulting archive." I understood this from developer.apple.com/videos/play/wwdc2019/416Arlindaarline
B
13

When you set SKIP_INSTALL=NO (which is the default), the build target will be installed to $(DSTROOT)$(INSTALL_PATH) during the build phase. Setting SKIP_INSTALL=YES causes the target to be built but not installed.

Setting SKIP_INSTALL=YES can be useful for static archives (libsomething.a) that will be later linked into other targets or bundles that will be installed by another target's copy-files build phase.

Baba answered 30/10, 2014 at 21:34 Comment(3)
It's not clear what 'This' refers to in your 2nd paragraph. Do you mean setting it to NO is needed for static archives or setting it to YES? Can you make an edit?Anorak
The opposite. You probably DON'T want to install intermediate static archives.Baba
I think the usage of 'intermediate' here was key. Because a static archive's symbols get added to the app's main binary. Having it installed 'again' into the final app bundle only consumes useless spaceAnorak
C
0

Skip Install (SKIP_INSTALL)

In case with archive

xcodebuild archive SKIP_INSTALL=NO

NO - allows to put data into <some_path>/<some_name>.xcarchive/Products or install a framework in archive

Commandeer answered 20/4, 2021 at 13:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.