defaults read com.apple.dt.Xcode > ~/Desktop/XcodeDefaults.plistIf you delete/move the current plist, Xcode will write a fresh one next time you run it.
killall Xcode
mv ~/Library/Preferences/com.apple.dt.Xcode.plist ~/Desktop/XcodeDefaults.plist
open -b com.apple.dt.Xcodedefaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool YESdefaults write com.apple.dt.Xcode BuildSystemScheduleInherentlyParallelCommandsExclusively -bool YESXcode 9.3 now runs more Swift build tasks in parallel with other commands. This may improve build times for Swift projects, but may also increase memory use during the build. This feature can be disabled from Terminal by setting a user default with
defaults write com.apple.dt.Xcode BuildSystemScheduleInherentlyParallelCommandsSerially -bool YESdefaults write com.apple.dt.Xcode PegasusMultipleCursorsEnabled -bool YESdefaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`Where sysctl -n hw.ncpu gives you the number of CPU threads.
defaults write com.apple.dt.Xcode PBXNumberOfParallelBuildSubtasks `sysctl -n hw.ncpu`Where sysctl -n hw.ncpu gives you the number of CPU threads.
defaults delete com.apple.dt.Xcode IDEIndexDisable
defaults write com.apple.dt.Xcode IDEIndexEnable -bool YESdefaults delete com.apple.dt.Xcode IDEIndexEnable
defaults write com.apple.dt.Xcode IDEIndexDisable -bool YESdefaults write com.apple.dt.Xcode IDEIndexerActivityShowNumericProgress -bool YESThis will show you why a particular file is having trouble being compiled for indexing.
defaults write com.apple.dt.Xcode IDEIndexShowLog -bool YESdefaults write com.apple.dt.Xcode IDEShowPrebuildLogs -bool YESIf set to SourceKit will write a log to /tmp with all the details of what it is doing while indexing. A lot of people find they have header hygiene problems or module problems that happen to work while building in certain configurations but aren't actually correct, resulting in missing modules or broken headers from the indexer's point of view. May not work anymore.
defaults write com.apple.dt.Xcode IDESourceKitServiceLogLevel -int 3 Deactivates the Main Thread Checker. Found in Xcode 12 release notes
defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YESPrevents Xcode from automatically restoring the last open project. This enables running multiple Xcode versions for different projects.
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState -bool YESdefaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YESThis slows down the build system & litters DerivedData//Build/Intermediates.noindex), generally should only be enabled when trying to capture a trace for incremental build debugging purposes.
defaults write com.apple.dt.XCBuild EnableBuildDebugging -bool YESMake Xcode's Assistant aware of your ViewModels, Views, etc. Found by @peterfriese
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View" "Screen"Do not move files when you restructure things in an Xcode project. Found by @steinpete
defaults write com.apple.dt.Xcode IDEDisableStructureEditingCoordinator -bool YES Stop Xcode from reopening files on launch. Found by @SmileyKeith
defaults write com.apple.dt.Xcode IDEDisableStateRestoration -bool YESdefaults write com.apple.iphonesimulator AllowFullscreenMode -bool YESCreates an XCBuildData folder in ~/Library/Developer/Xcode/DerivedData/<your target>/Build/Intermediates.noindex/ which contains debugging info for xcodebuild.
defaults write com.apple.dt.XCBuild -bool YES... provided Xcode is set to default folder locations. This is a quick win and helps to get back gigabytes of storage space. Do this regularly.
rm -rdf ~/Library/Developer/Xcode/DerivedData/*... provided Xcode is set to default folder locations.
CACHE=$(getconf DARWIN_USER_CACHE_DIR)
rm -rdf ${CACHE}com.apple.DeveloperTools
rm -rdf ${CACHE}org.llvm.clang.$(whoami)/ModuleCache
rm -rdf ${CACHE}org.llvm.clang/ModuleCache
rm -rdf ~/Library/Caches/com.apple.dt.*/*TMP=$(getconf DARWIN_USER_TEMP_DIR)
rm -rdf ${TMP}*.swift
rm -rdf ${TMP}ibtool*
rm -rdf ${TMP}*IBTOOLD*
rm -rdf ${TMP}supplementaryOutputs-*
rm -rdf ${TMP}xcrun_db
rm -rdf ${TMP}sources-*
rm -rdf ${TMP}com.apple.dt.*
rm -rdf ${TMP}com.apple.test.*- DevCleaner If you want to reclaim tens of gigabytes of your storage used for various Xcode caches - this tool is for you!