What is an
Xcode often creates a “SomeProject.xcworkspace” file. What is it?
.xcworkspace file corresponds to a “workspace” created in Xcode via
File > New > Workspace.... You can open them in Xcode, just like you can open projects.
But it’s not actually a file, it’s a directory. Only Finder attempts to confuse you by displaying directories with this extension as files.
The important file is
SomeProject.xcworkspace/contents.xcworkspacedata. This is an XML file, which looks like:
<?xml version="1.0" encoding="UTF-8"?> <Workspace version="1.0"> <FileRef ...></FileRef> <Group ...> <FileRef ...></FileRef> ... </Group> <FileRef ...></FileRef> ... </Workspace>
That is, an arbitrary tree, where the root is a
<Workspace> element, the leaves are
<FileRef> elements, and everything in-between is a
<Groups> are like directories; they are displayed as a directory tree in the “Project navigator” when you open the workspace in Xcode. An example of a
<Group location="container:" name="foobar"> </Group>
name property is the title in the Project navigator. (What is
container:? Who knows?!)
<FileRef> elements are like “files” in those “directories”. An example of a
What is that
group: protocol? It includes an XCode project as the sole member of a “group”.
foo/bar/SomeProject.xcodeproj is relative to the directory containing the
.xcworkspace. So if you have
$ROOT/SomeProject.xcworkspace/contents.xcworkspacedata containing a
<FileRef location="group:foo/bar/SomeProject.xcodeproj"></FileRef>, the relative path resolves to
More by Jim
- Your syntax highlighter is wrong
- Granddad died today
- The Three Ts of Time, Thought and Typing: measuring cost on the web
- I hate telephones
- The sorry state of OpenSSL usability
- The dots do matter: how to scam a Gmail user
- My parents are Flat-Earthers
- How Hacker News stays interesting
- Project C-43: the lost origins of asymmetric crypto
- The hacker hype cycle
- The inception bar: a new phishing method
- Time is running out to catch COVID-19
- A probabilistic pub quiz for nerds
- Smear phishing: a new Android vulnerability
Tagged . All content copyright James Fisher 2016. This post is not associated with my employer. Found an error? Edit this page.