Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the project.xcworkspace file important?

I am doing command line xcodebuild using a shell script. My problem is if I open and close the xx.xcodeproj file once and then use that command it works well.

Somehow if I get deep into the file changes, this project.xcworkspace is the only file that has changed. Is this file valid and should I check it into version control? Will this cause any issues?

I've heard that it's as important as .pbxproj: is this true?

I couldn't find any valid documentation which talks about the roles and responsibilities of various files in the xcode project files. Please provide links which help me to understand that.

like image 483
thndrkiss Avatar asked Jun 08 '12 21:06

thndrkiss


People also ask

Should I check in Xcworkspace?

In short yes it should be commited. I have my xcworkspace file checked in to my repo. If you don't use a workspace it probably isn't needed but as I use Cocoapods this creates a xcworkspace with the original project and the pods project inside of it.

What is the Xcworkspace file?

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.

Should I open Xcodeproj or Xcworkspace?

The xcworkspace is created by cocoapods and needs to be opened instead of the xcodeproj. So that xcode resolves dependencies properly. The output in your browser seems fine. When you see a JavaScript file, at least it means that it was built properly.

What is the difference between Xcworkspace and Xcodeproj?

1) Projects contain files (code/resouces), settings, and targets that build products from those files and settings. Workspaces contain projects which can reference each other. 2) Both are responsible for structuring your overall project, but on different levels. 3) I think projects are sufficient in most cases.


2 Answers

project.xcworkspace is a directory of files describing the workspace or projects. Although some of the answers here indicate it is unnecessary and should be ignored for source control, I don't agree, but it's going to be highly dependent upon how you use your environment. Generally, the contents of the project.xcworkspace directory contains the contents.xcworkspacedata file, which lists the projects that are included as top-level entities in your project, an xcuserdata directory, which contains each user's settings (should be ignored for source code controL), and xcshareddata, which is data shared by users who share a project, and should be under source control.

In environments where you don't share workspaces, or where you use simple workspaces, you can ignore these as well, however in environments where you put related projects in the same workspace and share that configuration, you may well want to keep these.

like image 184
gaige Avatar answered Sep 21 '22 19:09

gaige


I don't think project.xcworkspace under xx.xcodeproj is important enough to be added to SCM because it can be automatically recreated by Xcode if you delete it. Actually it has nothing to do with Cocoapods.

If you create a workspace named x.xcworkspace, create a project named y.xcodeproj and add the project to x.xcworkspace at the same time; then you will find that there is no project.xcworkspace created under y.xcodeproj directory.

However, if you open y.xcodeproj with Xcode, project.xcworkspace is automatically created under y.xcodeproj folder by Xcode.

like image 21
DawnSong Avatar answered Sep 18 '22 19:09

DawnSong