Xcode 快照

发布于 2024-08-23 13:43:50 字数 172 浏览 9 评论 0原文

移动或重命名 Xcode 项目后,Xcode 到底会如何处理项目快照。我注意到它们完全消失了......我应该看哪里?

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

栩栩如生 2024-08-30 13:43:51

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

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

~/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.

沐歌 2024-08-30 13:43:51

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

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.

顾北清歌寒 2024-08-30 13:43:51

它们在图像中好吧...但是要让 Xcode 识别它们并不那么容易...

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

所以,如果你真的想移动/重命名 yar 项目,你需要更改那个小 plist 文件中的所有路径......

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

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

乖乖公主 2024-08-30 13:43:51

您应该注意的另一件事:

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

因此,请记住在启动 Xcode 之前卸载存储库。

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

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.

新人笑 2024-08-30 13:43:51

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文