Xcode 4 builds everything into $HOME/Library/Developer/Xcode/DerivedData/$PROJECT-$UUID
, where $UUID
is a seemingly random string (it's not really random, it just looks random).
How can I reliably detect the $PROJECT-$UUID
part of the above? I've seen a script (https://gist.github.com/949831) that guesses by assuming it is the last modified directory in DerivedData -- but that's not true if my CI machine is building a few projects in parallel.
My DerivedData folder is supposed to be in Library/Developer/Xcode/DerivedData.
You'll find your derived data folder in your macOS user library. To find your derived data folder, open a new Finder window. In the Finder menu bar, select Go ▸ Go to Folder…. Click Go to change the Finder window's path to DerivedData.
Delete Derived DataChoose Window -> Organizer. Select the Projects tab. Select your project on the left. Next to the Derived Data line, there click the Delete button.
-derivedDataPath PATH specifies the directory where build products and other derived data will go ... (See e.g: https://stackoverflow.com/questions/33044633/command-line-option-to-change-xcode-deriveddata-location ) Keep in mind, depending on your Xcode project configs changing the derived data dir might cause issues.
Nobody answered, so I kept looking for ideas until I found the one below, which satisfies my needs. It can be further modified to be even safer.
ln -sf "$BUILD_DIR" BuildDir
Now, when the target is built a symlink to the project's DerivedData directory will be created in the project directory. If desirable, you can also/instead create BuildDir as a file who's content is the $BUILD_DIR:
echo "$BUILD_DIR" > BuildDir
Then in a script use $(cat BuildDir)
to retrieve it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With