Search code examples
xcode4automationhudson

How to find xcode build directory from the command line?


There are lots of questions/answers about controlling where to put the 'build' directory when building Xcode projects from the command line, but rather than trying to fight this is there a way to get the path that Xcode is using?

I know it puts the files in ~/Library/Developer/Xcode/DerivedData/APPNAME-xxx/Build/ where xxx is some random-looking string. I want to be able to get this directory from the command line so that I can archive my .app and .dSYM files, and also re-sign and package my .app using xcrun PackageApplication, which I currently use to create an over-the-air installable version directly form the build-server (hudson).


Solution

  • From command line

    xcodebuild -project yourproj.xcodeproj -showBuildSettings | grep TARGET_BUILD_DIR
    

    Remove the grep pipe, to see a list of all build settings, and choose one that is most appropriate for what you are looking for