Skip to content

Instantly share code, notes, and snippets.

@TadeasKriz
Created October 20, 2023 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TadeasKriz/6213d972aca38b8dd915884908570c63 to your computer and use it in GitHub Desktop.
Save TadeasKriz/6213d972aca38b8dd915884908570c63 to your computer and use it in GitHub Desktop.
Workaround Xcode 15 bug that makes it rebuild plugin cache on each startup

It's possible this bug was present in previous versions of Xcode, but we got aware of it in Xcode 15, because it started crashing with our Xcode Kotlin plugin.

It's a result of Xcode validating the plugin cache, but finding it invalid. Because the plugin cache doesn't contain an entry for IDEPerformanceDebugger.framework, Xcode needs to rebuild the plugin graph. Once the plugin graph is rebuilt, Xcode goes to save it. However since IDEPerformanceDebugger is disabled by default, Xcode doesn't include an entry for it in the plugin cache. As you can see, this leads to Xcode never using the plugin cache, because it's always invalid.

The workaround we found is:

  1. In Terminal, run defaults write com.apple.dt.xcode IDEPerformanceDebuggerEnabled -bool true && killall -u $USER cfprefsd
  • This enables the IDEPerformanceDebugger.framework plugin.
  1. Open Xcode 15
  • Since the plugin is enabled, Xcode includes it in the new plugin cache it saves
  1. In Terminal, run defaults delete com.apple.dt.xcode IDEPerformanceDebuggerEnabled && killall -u $USER cfprefsd
  • We don't want to keep the plugin enabled, so we disable it again.

Because it's a cache, it's possible that it will get deleted at some point and you'd have to repeat the process. Hopefully it'll get fixed by the Xcode team soon.

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