Most people is familiar with Xcode theme support for the text editor. You simply open Preferences, Fonts & Colors and duplicate
an existing theme (or create a new one from scratch). Xcode editor themes have the .dvtcolortheme
extension.
However, there's some support for themeing Xcode itself (fonts, gradients, colors). Xcode loads the default theme from
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Default.dvttheme
.
.dvttheme
files are simply XML files that conform to an undocumented schema. If you want to modify any of the settings in
Default.dvttheme
, instead of modifying the bundle resource file you can instruct Xcode to load your custom .dvttheme
from
wherever you want:
defaults write com.apple.dt.xcode DVTUseTheme <Path_to_your.dvttheme>
You can have an idea of the available settings by inspecting a recent class dump for DVTTheme
:
https://github.com/luisobo/Xcode-RuntimeHeaders/blob/master/DVTKit/DVTTheme.h
If you have debugged an Xcode extension before, you may have noticed that the debugged instance of Xcode has a different, darker
theme. This is also built on top of DVTTheme
. You can have this darker theme by default by setting a configuration default:
defaults write com.apple.dt.xcode IDEExtensionDebuggingHost -bool YES
Of course, this is totally undocumented and unsupported, but we should encourage Apple to clean up and expose this themeing API in a future Xcode version, as there's interest in having a true "dark mode" Xcode theme that matches "dark mode" macOS.
This "darker theme" only changes the background color of the build info box and changes the app icon to black. For those reading, it is not a dark mode if you wanted that like me…