Q:

Xcode: Adding WorkspaceSettings.xcsettings to source control

In Xcode, changing settings in File > Workspace Settings... are stored for each Xcode user separately. I want workspace settings to be set the same for all users. My goal it to have the built targets to be copied in the same relative directory.
By default workspace settings are stored in:

[WorkspaceName].xcworkspace/xcuserdata/[UserName].xcuserdatad

I want the ability make this shared across all users so I can add it to version control.

A:

We ended up writing a small bash script that performed four default write commands to set the correct settings
scriptPath="$(dirname "$0")"
cd "$scriptPath"
fullPath=$(pwd)
settingsFile="$fullPath"/<project>.xcworkspace/xcuserdata/$USER.xcuserdatad/WorkspaceSettings.xcsettings

cp -f "$settingsFile" "$settingsFile.plist"

defaults write "$settingsFile" BuildLocationStyle CustomLocation
defaults write "$settingsFile" CustomBuildLocationType RelativeToWorkspace
defaults write "$settingsFile" CustomBuildProductsPath "Build/Products"
defaults write "$settingsFile" CustomBuildIntermediatesPath "Build/Intermediates"

cp -f "$settingsFile.plist" "$settingsFile"

