Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 641
jhabbott Avatar asked Jun 22 '12 13:06

jhabbott


People also ask

Where is the Xcode build folder?

It should by located in: ~/Library/Developer/Xcode/DerivedData . Save this answer. Show activity on this post. You can configure the output directory using the CONFIGURATION_BUILD_DIR environment variable.

Where is my Xcode project located?

By default projects are saved in User/Documents/xCode.

What is Xcode build command?

xcodebuild is a command-line tool that allows you to perform build, query, analyze, test, and archive operations on your Xcode projects and workspaces from the command line. It operates on one or more targets contained in your project, or a scheme contained in your project or workspace.


1 Answers

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

like image 57
Slav Avatar answered Oct 02 '22 06:10

Slav