Xcode workspace is a directory (not a file) which has a .xcworkspace
extension. Finder shows it as a package. It actually is an Xcode document that groups projects and other documents so can be worked together in your project.
A workspace can contain any number of Xcode projects, plus any other files you want to include.
When you open an XCWORKSPACE
, it opens the associated project and restores the perspective. Therefore, Xcode workspace files can be used as a wrapper or container for an Xcode .XCODEPROJ
project.
Xcode workspace directory includes a vital XML file named contents.xcworkspacedata
, and it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MySampleProject.xcodeproj">
</FileRef>
<FileRef
location = "group:OtherProject(for example Pods).xcodeproj">
</FileRef>
</Workspace>
In this arbitrary tree, group:
represents the directory of your project/s (as many you have).
Additionally .xcworkspace
always exists it may be external to an .xcodeproj
, or embedded within one. Therefore, whenever you see .xcworkspace
you have to use it to open your project.