Introduction
An .xcworkspace gathers several
Xcode projects and other files so that
Xcode opens and builds them together.
Finder shows it as one file, but it is a folder. Every .xcodeproj also has
an implicit one inside it, at project.xcworkspace.
A workspace’s contents.xcworkspacedata dropped on this site opens in the
explorer, and an .xcworkspace folder dropped whole is named as a
workspace with the projects it lists and the other files it holds (see
other files in the bundle).
Structure
The folder holds contents.xcworkspacedata, an XML file whose
Workspace root lists what the workspace contains:
| Element | Attributes | Meaning |
|---|---|---|
Workspace | version | The root; version 1.0. |
FileRef | location | A project or file in the workspace. |
Group | location, name | A folder of references in Xcode’s navigator; it holds more FileRef and Group elements. |
A location is a kind, a colon and a path. group: is relative
to the enclosing group, container: is relative to the folder holding the
workspace, self: is the workspace itself, and absolute: is a
full path.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
<FileRef location = "group:App/App.xcodeproj"></FileRef>
<FileRef location = "group:Kit/Kit.xcodeproj"></FileRef>
</Workspace>
Beside it, xcshareddata holds settings and shared
schemes, and
xcuserdata holds each person’s own state, which is usually left out of
version control.
Other files in the bundle
Apple does not document these files. The meanings below come from the open-source readers named in each row, and are marked “from the name” where no source says more.
| File | What it holds | Opens as |
|---|---|---|
xcshareddata/WorkspaceSettings.xcsettings | A property list. BuildSystemType (Original for the legacy build system), DerivedDataLocationStyle (Default, AbsolutePath or WorkspaceRelativePath), DerivedDataCustomLocation, IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded (Xcode creates schemes by itself) and, in real files, PreviewsEnabled (from the name). Keys: tuist/XcodeProj, WorkspaceSettings.swift. | Property list |
xcshareddata/IDEWorkspaceChecks.plist | A property list; real files hold one key, IDEDidComputeMac32BitWarning (a flag that Xcode has run its 32-bit Mac check; from the name). | Property list |
xcshareddata/swiftpm/Package.resolved | The pinned version of each Swift package dependency, as JSON in one of three layouts (1, 2 and 3, told apart by version): package, repositoryURL and state (version 1); identity, kind (localSourceControl, remoteSourceControl or registry), location, an optional originalLocation and state with version, branch and revision (versions 2 and 3); version 3 adds originHash. Source: swift-package-manager, ResolvedPackagesStore.swift. SwiftPM refuses an unknown version, a package listed twice, and a state with none of version, branch and revision; the viewer reports those as problems. | Swift Package Manager pins |
xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist and the same in xcuserdata/user.xcuserdatad/xcdebugger/ | XML: a Bucket (type, version) of BreakpointProxy elements, each with a BreakpointExtensionID (file, exception, Swift error, OpenGL error, symbolic, Auto Layout constraint error, test failure or runtime issue breakpoint) and a BreakpointContent (shouldBeEnabled, ignoreCount, filePath, the starting and ending line and column, symbolName, moduleName, scope, condition, Actions and Locations). Source: tuist/XcodeProj, XCBreakpointList.swift. | Xcode breakpoints list |
xcshareddata/xcschemes/*.xcscheme | Shared schemes. | Xcode scheme |
xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate | One person’s window and editor state: a binary property list archived with NSKeyedArchiver (it has $archiver, $version, $objects and $top keys). The explorer’s Archive tab resolves the archive the way Foundation’s NSKeyedUnarchiver does: every CF$UID reference is followed into $objects, each object is shown under the class named in $classes, an NSDictionary is its NS.keys and NS.objects, an NSArray its NS.objects, and NSString, NSDate (NS.time, seconds from 1 January 2001), NSURL, NSData and NSUUID by their own keys; an object reached twice is shown once and then pointed at, and a data value that is itself a binary property list (codablePlistRepresentation) is opened in place. What Xcode stores there: for each window (keyed by a workspace UUID) IDEWindowFrame (the window’s x, y, width and height, then its screen’s), IDEWindowIsFullScreen, one IDEWorkspaceTabController_UUID dictionary for each workspace tab (IDEShowNavigator, IDENavigatorWidth, IDEShowUtilities, IDEUtilitiesWidth, the IDENavigatorArea with its SelectedNavigator, and the IDEEditorArea with EditorMode and, in EditorTabBarState, the open files as IDEEditorHistoryItem objects holding a DVTDocumentLocation with a documentURL, and per-editor keys such as SourceCodeEditor.scrollState.line, SourceCodeEditor.codeFolding and XcodePreviews.Zoom). Foundation’s side: swift-corelibs-foundation, NSKeyedUnarchiver.swift and the init?(coder:) of NSArray, NSDictionary, NSString, NSDate, NSURL, NSData and NSUUID. The Xcode key names are those read from real files; Apple documents none of them, so a key not named here is shown with its value and no meaning. | Property list (binary), Archive tab |
xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist | A property list of one person’s scheme order and visibility. | Property list |
Each of these opens by itself when dropped. A dropped .xcworkspace folder lists them
all, with a summary of each and the keys of the two small property lists. A file this table does not
name is listed as not described.
Not described
Known, not yet covered
Nothing that is named here is left unread: every file above opens in the explorer.
Unknown
- Reference: the meaning of
PreviewsEnabled(a boolean inWorkspaceSettings.xcsettings; Flutter’s iOS templates and its cocoon dashboard writefalse) and ofIDEDidComputeMac32BitWarning(a booleantrueinIDEWorkspaceChecks.plist, as in WebKit’s workspace and Flutter’s libzip). Searched: tuist/XcodeProj, Apple’s Xcode and SwiftUI previews documentation, Xcode’s release notes, Apple Developer Forums (a thread on the Xcode 9.3 32-bit warning explains the warning, not the file) and public repositories holding the files; none states what either key does, so the readings “previews on or off” and “the 32-bit Mac check has run” stay inferred from the names. Xcode’s.xcuserstateclass and key names are likewise Apple-undocumented: the Archive tab shows each one as the file names it. - Reference: any other file Xcode writes in a workspace bundle (for example
.xcscmblueprintsource-control files): not described, and a folder listing marks it so.
Links
Software
- Xcode – Apple’s IDE, which makes and opens workspaces (macOS)