15

(I have a mac running Mountain Lion with Xcode 4.5.2)

I changed my username a while ago, and Xcode has started recreating xcuserdata directories with the new username at $path_to_.xcodeproj/xcuserdata/blackl.xcuserdatad. I've been working with it like that since, and I can't remember if anything seemed to have reset after the change, so whatever was in there must not have been too important…

What does Xcode store in xcuserdata and what should I do about the old ones? There are some old projects I haven't opened since the change; I could just rename the directories in those. Newer projects will have two directories (blackl.xcuserdatad and one with the old username); what should I do in those cases?

Blacklight Shining
  • 1,468
  • 2
  • 11
  • 28

1 Answers1

22

You can safely delete the xcuserdata directories. It basically contains personal settings like breakpoints, user interface layout, open files, automatic snapshots configuration and so on.

Most people ignore those files in their version control software. I do that too.

BTW: there's another xcuserdata directory inside of $path_to_.xcodeproj/project.xcworkspace.

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
  • You don't mean to say it contains the snapshots themselves, do you? I thought those were stored in `~/Library/Developer/Xcode` somewhere. As for the directories in `project.xcworkspace`, should I delete those too? – Blacklight Shining Nov 19 '12 at 12:30
  • Those settings files are just plist, you can inspect them easily. `WorkspaceSettings.xcsettings` contains just the snapshot settings, not the snapshots. Mine has two keys `HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges` and `SnapshotAutomaticallyBeforeSignificantChanges`. Nothing important is saved inside the xcuserdata directory. – Matthias Bauch Nov 19 '12 at 12:33
  • Okay. So I should just delete the old directories in `$path_to_.xcodeproj/{xcuserdata,project.xcworkspace}`? – Blacklight Shining Nov 19 '12 at 12:34
  • how to delete them using terminal? I used "find . -name 'xcuserdata' -type d -delete" but nothing happened. – axunic Feb 20 '18 at 06:12
  • 1) Right click .xcodeproj file (or .xcworkspace file if you use Cocoapods) and choose Show Package Contents. 2) delete xcuserdata folder – Rameez Mar 25 '18 at 05:55