Xcode lets you customize its behavior through the Xcode Preferences window, which includes settings to handle the most common customizations. However, Xcode also lets you perform customizations to settings that are not present in the user interface. Xcode uses user defaults to let you change the value of these settings. User defaults is a Mac OS X subsystem that lets you customize the behavior of applications using the defaults
command.
The defaults
command takes a command and a domain. The user domain for Xcode is com.apple.Xcode
. The most-used commands are write
(to set the value of a user default) and read
(to get the value of a user default). Here’s the format of the command invocation to set the value of an Xcode user default:
> defaults write com.apple.Xcode <key> <value> |
key
: The name of the Xcode user default to set.
value
: The new value for the user default.
This the invocation used to get the value of a user default:
> defaults read com.apple.Xcode <key> |
The user-defaults system lets you override the built-in values of settings used in Xcode. The built-in default value of a setting is encoded in the application, not in the Xcode user-defaults domain. Therefore, when a particular setting is not present in the Xcode user-defaults domain, its default value may vary depending on the Xcode release you’re using.
The Xcode user-defaults domain applies to all instances of Xcode installed on your computer. Therefore, when setting user-default values, you must ensure that all the releases of Xcode you’re using support that user-default and its new value.
To learn about using multiple Xcode releases in one computer, see Xcode Installation Guide.
The following sections list and describe the Xcode user defaults.
Description | Specifies the period (in milliseconds) after text is selected that a click-and-drag event on the selected text is processed as the beginning of a drag-and-drop operation. |
Value | A positive value defines the drag-and-drop period. A negative value or zero deactivates text drag and drop. |
Description | Specifies the maximum number of items to show in the File > Recent Projects menu. |
Value | Positive integer. Default: |
Description | Specifies extra paths in which to look for Xcode plug-ins beyond the standard |
Value | Set of strings. Default: None. |
Description | Dictionary of extra macros for use in project and file templates. |
Keys |
|
Description | Specifies whether Xcode displays a warning when it is unable to save a project package. Useful for developers using an SCM system that makes project packages nonwritable. |
Value |
|
Description | Specifies whether output in the Console window is cleared after each session. |
Value |
|
Description | Specifies whether Xcode opens the first Xcode project inside the selected folder in an Open panel when the user clicks the Open button. Using this feature may cause problems with keyboard-based navigation of Open panels. |
Value |
|
Description | Specifies the list of encodings shown in Encodings menus. This list uses the same format as the encodings list in the TextEdit user defaults. You can copy that list from |
Value | Array. Default: None. |
Description | Specifies whether the text editor beeps when a closing brace ( |
Value |
|
Description | Specifies the path to the |
Value | Pathname. Default: |
Description | Specifies the path to the shell editor to use in Worksheet windows (which combine a full-featured shell and a text editor). |
Value | Pathname. Default: |
Description | Specifies the path to the |
Value | Pathname. Default: |
Description | Specifies whether the declarations menu in the text editor shows class declarations. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows class definitions. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows function declarations. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows function definitions. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows method declarations. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows method definitions. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows type definitions. |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows |
Value |
|
Description | Specifies whether the declarations menu in the text editor shows |
Value |
|
Description | Specifies whether Xcode attempts to preserve POSIX file permissions when saving a file. |
Value |
|
Description | Specifies whether double-clicking a quotation mark, brace, or parenthesis causes the text editor to scroll to the opposite end of the resulting selection. |
Value |
|
Description | Specifies whether the text editor highlights the corresponding scope delimiter (parentheses, bracket, or brace) as one is typed. |
Value |
|
Description | Specifies whether the text editor uses code completion in plain text, nonsource files. When active in these files, code completion processes only the words present in the file, along with language keywords and text macros defined for the file’s type. |
Value |
|
Description | Specifies whether the text editor selects text inside quotation marks when double-clicking quotation marks ( |
Prerequisite | Selection to matching brace is active (Xcode Preferences > Text Editing). |
Value |
|
Description | Specifies whether Xcode displays a warning when an undo operation on an open file would take it to a state prior to the file’s last save operation. |
Value |
|
Description | Specifies whether the text editor manages spaces when inserting and deleting spaces around words when text is inserted or deleted. |
Value |
|
Description | Specifies whether the text editor reindents source code that is pasted when syntax-aware indenting (Xcode Preferences > Indentation) is active. |
Value |
|
This user default is a dictionary that specifies the whitespace Xcode applies in code completion and text-macro expansion.
To specify or add XCCodeSenseFormattingOptions
keys to the Xcode user defaults database, use the -dict
and -dict-add
options of the defaults
command. For example:
> defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict PreExpressionsSpacing "" PreCommaSpacing " " |
The following table describes the XCCodeSenseFormattingOptions
keys you can define to override the default values.
Key | Value | |
---|---|---|
PreExpressionsSpacing | Whitespace between an Default: | |
InExpressionsSpacing | Whitespace inside a parenthesized expression—after the opening parenthesis and the closing parenthesis. Default: | |
PreFunctionArgsSpacing | Whitespace between a function name and the opening parenthesis. Default: | |
InFunctionArgsSpacing | Whitespace inside a parenthesized function argument list—after the opening parenthesis and the closing parenthesis. Default value: | |
PreCommaSpacing | Whitespace before a comma inside a function argument list. Default: | |
PostCommaSpacing | Whitespace after a comma inside a function argument list. Default: | |
PreMethodTypeSpacing | Whitespace before the parenthesized return type in an Objective-C method declaration. Default: | |
PreMethodDeclSpacing | Whitespace between the parenthesized return type and the method name in an Objective-C method declaration. Default: | |
InMessageSpacing | Whitespace inside an Objective-C message expression—after the opening bracket and before the closing bracket. Default: | |
PreColonSpacing | Whitespace before a colon in an Objective-C method name or message expression. Default: | |
PostColonSpacing | Whitespace after a colon in an Objective-C method name or message expression. Default: | |
MessageArgSpacing | Whitespace between the parenthesized type and argument name in an Objective-C method declaration. Default: | |
CaseStatementSpacing | Relative indentation of a case keyword inside a switch block. A tab ( Default: | |
BlockSeparator | Whitespace after the parenthesized expression of an Default: | |
PostBlockSeparator | Whitespace after the closing brace of a block. Default: | |
FunctionBlockSeparator | Whitespace after a method or function name and argument-list declarations and its body. Default: |
Description | Specifies whether the text editor performs syntax coloring on files containing source code in languages unknown to Xcode. Syntax coloring on unknown languages follows these rules:
|
Value |
|
Description | Specifies whether the text editor aligns new lines (after pressing Return) with the previous line when syntax-aware indenting (Xcode Preferences > Indentation) is unavailable for the current file, either because it’s inactive or because the type of the current file doesn’t support it. |
Value |
|
Description | Specifies whether the text editor identifies control characters using an inverted question mark ( |
Value |
|
Description | Specifies whether the text editor identifies nonbreaking space characters (Unicode |
Value |
|
Description | Specifies the location at which to save the source code index, instead of the standard location. |
Value | Pathname (absolute or relative to the project directory). Default: |
See | “OBJROOT (Intermediate Build Files Path)” in Xcode Build Setting Reference. |
Description | Specifies the desired maximum size (in megabytes) of the precompiled header (PCH) cache. Xcode obtains the size of the cache on launch and at the end of each build. If the cache size is greater than the desired maximum, Xcode attempts to bring the cache size below the maximum by removing the oldest precompiled-header files from the cache. |
Value | Positive integer. Default: |
See |
Description | Specifies the minimum age (in hours) a precompiled-header file must be in order for it to be a candidate for removal during a cache-size reduction operation. |
Value | Positive integer. Default: |
See |
Description | Specifies the desired number of parallel tasks Xcode uses during builds. |
Value | Positive integer. Default: Number of CPU cores on the build host. |
Description | Specifies whether the built products and intermediate build files are grouped by build configuration. |
Value |
|
Description | Specifies the period (in seconds) to wait after a source file is edited before Xcode starts a predictive compile. |
Prerequisite | Predictive compilation is active (Xcode Preferences > Building). |
Value | Positive integer greater than |
Important | When specified, Xcode enforces a minimum value of |
Description | Identifies the build failure sound. |
Value | Pathname to a sound file. Default: None. |
Description | Identifies the build success sound. Pathname to a sound file. |
Value | Pathname to a sound file. Default: None. |
Description | Specifies the log level of the shared-workgroup-build manager. |
Value |
Default: |
Description | Specifies whether shared workgroup builds produce verbose logging. |
Value |
|
Description | Specifies the maximum number of concurrent shared-workgroup-build tasks. |
Value | Positive integer. Default: |
Description | Identifies the |
Value | Absolute pathname. Default: |
Description | Specifies whether Xcode logs its communications with GDB to a file. This file can be sent to Apple when reporting problems with the debugger. |
Value |
|
Important | Logging Xcode/GDB interactions reduces the debugger’s stepping performance. |
See |
Description | Specifies the file to which Xcode/GDB communication is logged when Xcode/GDB–communication logging is active. This file is rewritten for every debugging session. |
Value | Absolute pathname. Default: |
See |
Description | Specifies the location of the snapshot repository. |
Value | Pathname. Default: |
Description | Specifies the maximum size (in kilobytes) of the SCM log. |
Value | Positive integer. Default: |
Description | Identifies the |
Value | Absolute pathname. Default: |
Last updated: 2009-07-14