Question

What exactly does Xcode do with project snapshots after the Xcode project is moved or renamed. I have noticed they completely disapear...Where should I look?

Defintely not in ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

Was it helpful?

Solution

~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage is a disk image. You have to mount it and look in there.

Snapshots are stored based on a hash of the project name; change the project name and you lose the snapshot history. If you take a snapshot of the new project, and can find the old snapshot on the disk image, you can probably move the old snapshot into the new one's directory.

OTHER TIPS

If they are not in ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage then I think you may be out of luck. I tend to rely on snapshots only as a first line of defence, with Time Machine as a more reliable second line, and then SCM and proper backups as the third and fourth.

They are inside the image allright... but making so that Xcode will recognize them won't be that easy...

In that image, you have the folder with all the snapshots (with some hierarchy)... and a plist file... in that plist file they have a HARDCODED (non relative to project file) paring system between each snapshot and the ORIGINAL PATH of the project folder.

So, if you really want to move/rename yar project, you'll need to change ALL the paths in that little plist file...

P.S. if you're gonna do the changes, you might wanna close Xcode before you do... it might make him angry... :P

Another thing you should be aware of:

If you open and mount ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage as a disk image and then start Xcode to recover or look into your snapshots Xcode will complain that the Snapshot Repository is broken and move it into the Trash!

So remember to unmount the repository before starting Xcode.

To recover a trashed Snapshot Repository just drag it into the correct path (see above) and remove the date stamp inside the filename.

I ran in to this issue having renamed the App and if I renamed it back to the original, quit Xcode and reopened it the restores were available again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top