Skip to content

Instantly share code, notes, and snippets.

@danielmartin
Last active February 6, 2022 14:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmartin/820901f36eb36afc28bed995f7ab4946 to your computer and use it in GitHub Desktop.
Save danielmartin/820901f36eb36afc28bed995f7ab4946 to your computer and use it in GitHub Desktop.
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
Copy link

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