53

I use svnX.

When importing project, I check "no ignore" option. (for importing libOAuth.a, ...)

But one file is causing a small problem.

UserInterfaceState.xcuserstate

What is this file?

Can I ignore this file? Is it important? Should I commit this file?

pkamb
  • 33,281
  • 23
  • 160
  • 191
ChangUZ
  • 5,380
  • 10
  • 46
  • 64

3 Answers3

43

What is this file?

You can open it in property list editor and have a look -- It stores things like your workspace/project document layouts, nothing you would lose sleep over if lost.

Can I ignore this file?

You would ignore it in all but exceptional cases. It's easily reconstructed, and should be considered local to your system's user account. To stretch imagination or reason to track it: If you worked by yourself and mirrored your user accounts, then you might want this information synchronized among your machines. Sure, you could track it, but it would produce a lot of unnecessary revision control noise.

justin
  • 104,054
  • 14
  • 179
  • 226
39

I recommend ignoring files that match these patterns:

*.xcuserstate
project.xcworkspace/
xcuserdata/

Basically, the only thing under MyProject.xcodeproj that you want checked in is project.pbxproj.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • Oops. I have changed my answer. – rob mayoff Jan 27 '12 at 05:08
  • 3
    So the file contents.xcworkspacedata under MyWorkspace.xcworkspace doesn't need to be versioned? What if you have multiple projects in 1 workspace? – Conrad Feb 24 '13 at 23:38
  • If you have explicitly created a workspace and added projects to it, you may want to store the workspace in version control. Most people just use the workspace that Xcode automatically creates inside a new standalone project, which is probably not worth storing. – rob mayoff Feb 25 '13 at 00:28
11

As of Xcode 7.3.1, UserInterfaceState.xcuserstate's are binary-formatted plist files that can exist in either of project files or workspace files. They are user-specific and many can be present in a given Xcode project or workspace.

Among other things they contain the current target your project is set to, the currently open file, and cursor position. These files can be saved to disk frequently if Xcode has the associated project open.

To convert the contents of the binary plist files to a more human-readable XML format you can use this plutil command in the terminal:

plutil -convert xml1 UserInterfaceState.xcuserstate

These files can safely be ignored in most cases.