24

Is there a way to determine from the command line what the location of your derived data folder is after building with xcodebuild?

For example, after running xcodebuild:

xcodebuild -project projectname -target targetname

I want to be able to find out which folder the app is in. I would like to do this without changing the output path with CONFIGURATION_BUILD_DIR or within the project settings.

Any ideas?

syvex
  • 7,518
  • 9
  • 43
  • 47

1 Answers1

44
xcodebuild -project myapp.xcodeproj -showBuildSettings

prints all build settings and values, in particular the folder where the app is build:

BUILT_PRODUCTS_DIR = /path/to/myapp/DerivedData/myapp/Build/Products/Release

Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
  • There was a similar question shortly after yours: http://stackoverflow.com/questions/13826375/is-it-possible-to-export-user-defined-xcode-build-settings-to-environment-variab/13827487#13827487, perhaps that is also of interest. – Martin R Dec 13 '12 at 18:52
  • 14
    I got what I wanted with some grepping like this: `xcodebuild -project projectname -target targetname -showBuildSettings | grep -m 1 "CONFIGURATION_BUILD_DIR" | grep -oEi "\/.*"` – syvex Dec 14 '12 at 18:12
  • unfortunately the path differs in the random postfix :/. I have no idea why… Any ideas? – kubbing Apr 25 '14 at 05:47
  • If you mean "Release" at the end, add `-configuration Debug` or the like to control that. – celticminstrel Jun 06 '21 at 18:39