在iOS APP中删除~/Library/Caches中的Fabric内容是否安全

Is it safe to delete Fabric contents in ~/Library/Caches in iOS APP

我们的 iOS APP 中的 ~/Library/Caches 中有 2 个文件夹:

com.crashlytics.data
io.fabric.sdk.ios.data

好像是Fabric用的?

我想添加一个功能来删除 Caches 文件夹中的所有内容,我想知道删除这 2 个文件夹是否安全?

如果我在APP运行的时候删除了2个文件夹,APP出现闪退会怎样?崩溃报告仍会发送到 Fabric 吗?

如有任何建议,我们将不胜感激。

根据 Apple 文档:

Put data cache files in the Library/Caches/ directory. Cache data can be used for any data that needs to persist longer than temporary data, but not as long as a support file. Generally speaking, the application does not require cache data to operate properly, but it can use cache data to improve performance. Examples of cache data include (but are not limited to) database cache files and transient, downloadable content. Note that the system may delete the Caches/ directory to free up disk space, so your app must be able to re-create or download these files as needed. (c)

这意味着,即使您的应用中没有任何附加功能,也可以删除这些文件夹。自己动手吧。

来自 Fabric 的 Todd。以编程方式删除它们是不安全的,因为它们包含我们的崩溃报告数据。文件夹 Library/Caches/com.crashlytics.data/ 是您的应用程序重新启动时上传崩溃的地方。谢谢!