Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Xcode unofficial theme support

Xcode unofficial (and undocumented) theme support

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

Dark mode for Xcode

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.

@NSExceptional

This comment has been minimized.

Copy link

@NSExceptional NSExceptional commented Aug 16, 2017

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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment