Xcode 快照

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2359097/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:09:30  来源:igfitidea点击:

Xcode snapshots

objective-cxcodesnapshot

提问by oberbaum

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?

在 Xcode 项目移动或重命名后,Xcode 究竟对项目快照做了什么。我注意到它们完全消失了......我应该去哪里看?

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

绝对不在 ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

回答by cdespinosa

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

~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage是磁盘映像。您必须安装它并在那里查看。

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.

快照基于项目名称的哈希存储;更改项目名称,您将丢失快照历史记录。如果您对新项目进行快照,并且可以在磁盘映像上找到旧快照,那么您可能可以将旧快照移动到新目录中。

回答by Paul R

If they are not in ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimagethen 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.

如果他们不在,~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage那么我认为你可能不走运。我倾向于仅依赖快照作为第一道防线,Time Machine 作为更可靠的第二道防线,然后 SCM 和适当的备份作为第三和第四道防线。

回答by xoconoxtle

Another thing you should be aware of:

您应该注意的另一件事:

If you open and mount ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimageas 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!

如果您打开并挂载~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage为磁盘映像,然后启动 Xcode 以恢复或查看您的快照,Xcode 会抱怨快照存储库已损坏并将其移至废纸篓!

So remember to unmount the repository before starting Xcode.

所以记得在启动 Xcode 之前卸载存储库。

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

要恢复废弃的快照存储库,只需将其拖到正确的路径中(见上文)并删除文件名中的日期戳。

回答by Alex Zak

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

它们都在图像中......但是制作以便Xcode能够识别它们不会那么容易......

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.

在该图像中,您拥有包含所有快照(具有某些层次结构)的文件夹......和一个 plist 文件......在该 plist 文件中,它们在每个快照和原始文件之间有一个硬编码(非相对于项目文件)配对系统项目文件夹的路径。

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

因此,如果您真的想移动/重命名 yar 项目,则需要更改该小 plist 文件中的所有路径...

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

PS如果你要进行更改,你可能想在你做之前关闭Xcode......这可能会让他生气......:P

回答by John

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.

我在重命名应用程序后遇到了这个问题,如果我将它重命名回原始版本,请退出 Xcode 并重新打开它,恢复再次可用。