1

Is there any way to change the settings of Xcode programmatically through Terminal? i.e. color scheme, key binding, etc.

I'm aware of Apple's Commandline Tools for Xcode for building, but there seems to be no command for altering the settings of the GUI.

It doesn't have to be an official way. I am looking for a way to get to the settings file related to Xcode. I've found some in here, but not sure how to change them.

/Users/YOURUSERNAMEHERE/Library/Developer/Xcode/UserData

Thanks in advance.

Naoto Ida
  • 1,275
  • 1
  • 14
  • 29

2 Answers2

2

The defaults command can be used to modify Xcode preferences:

term> defaults write com.apple.dt.Xcode.plist Xcode3BuildRulesEditorDisplayMode 1

As Naoto Ida mentioned, changes here will most likely not effect Xcode until it's relaunched.

geowar
  • 4,397
  • 1
  • 28
  • 24
0

I believe I may have found the answer.

/Users/YOURUSERNAMEHERE/Library/Preferences/com.apple.dt.Xcode.plist

seemed to contain all the user settings for Xcode.

This file is in binary format, so one must do this command:

plutil -convert xml1 -o - /Users/YOURUSERNAMEHERE/Library/Preferences/com.apple.dt.Xcode.plist

Then, you can see that it is in an XML format. You can, as @geowar suggests, write a command to make changes to the file, the changes to these files won't immediately come into effect, as these are cached elsewhere, meaning Xcode needs a restart.

Community
  • 1
  • 1
Naoto Ida
  • 1,275
  • 1
  • 14
  • 29