从 Xcode 快照手动恢复文件 [英] Manually recover files from Xcode snapshot

查看:37
本文介绍了从 Xcode 快照手动恢复文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从 Xcode (4.3.2) 快照手动恢复文件?每当我尝试恢复快照时 Xcode 都会崩溃,所以我猜这些文件以某种方式损坏了.我找不到其他地方引用的快照图像:~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

Is it possible to manually recover files from an Xcode (4.3.2) snapshot? Xcode crashes whenever I try to restore a snapshot, so I guess the files are corrupt somehow. I cannot find the snapshot image referenced elsewhere: ~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

但是,我发现了一个以 .xc​​snapshots 结尾的文件

However, I have found a file that ends with .xcsnapshots

是否可以使用 .xcsnapshots 文件恢复项目文件?如果是这样,如何?我无法理解.

Is it possible to recover project files using the .xcsnapshots file? If so, how? I cannot make any sense of it.

推荐答案

你能导出快照吗?导出快照类似于恢复它.主要区别在于,导出项目的快照会将其恢复到项目当前位置以外的文件夹.

Are you able to export the snapshot? Exporting a snapshot is similar to restoring it. The main difference is that exporting a project's snapshot restores it to a folder other than the project's current location.

要导出快照,请打开管理器并单击管理器顶部的项目"按钮.从管理器的左侧选择您的项目.选择快照.单击导出快照按钮以导出快照.

To export a snapshot, open the Organizer and click the Projects button at the top of the Organizer. Select your project from the left side of the Organizer. Select a snapshot. Click the Export Snapshot button to export the snapshot.

Xcode 4 使用 .xcsnapshots 文件来存储项目的快照.当您从管理器中选择一个项目时,管理器会显示该项目快照的位置.该位置旁边是一个带箭头的小按钮.单击该按钮可在 Finder 中显示 .xcsnapshots 文件.在 Finder 中选择 .xcsnapshots 文件,右键单击,然后选择 Show Package Contents 以显示 .xcsnapshots 文件的内容.从我可以看到的 .xcsnapshots 文件是一个 git 存储库.我没有看到使用 Finder 从 .xcsnapshots 文件访问单个文件的任何方法,但您可以使用 git 从命令行定位和恢复文件.

Xcode 4 uses the .xcsnapshots file to store snapshots for a project. When you select a project from the Organizer, the Organizer shows the location of that project's snapshots. Next to the location is a small button with an arrow. Click the button to show the .xcsnapshots file in the Finder. Select the .xcsnapshots file in the Finder, right-click, and choose Show Package Contents to show the contents of the .xcsnapshots file. From what I can see the .xcsnapshots file is a git repository. I didn't see any way to access an individual file from the .xcsnapshots file using the Finder, but you may be able to locate and recover a file using git from the command line.

这篇关于从 Xcode 快照手动恢复文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆