xcode 当 iOS 安装应用更新时,究竟会发生什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5225974/
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
What precisely happens when iOS installs an update to an app?
提问by Jesse Beder
What is the official, documentedbehavior when you install an update to an app?
当您为应用程序安装更新时,官方记录的行为是什么?
This questionasks the same thing, but the answer, which says that the app bundle is replaced but all other folders are untouched, does not provide any documentation. I have reasonto believe that the app bundle, in fact, is notreplaced, so I'd like to know for sure.
这个问题提出了同样的问题,但回答说应用程序包被替换但所有其他文件夹都没有改变,没有提供任何文档。我有理由相信应用程序包实际上并没有被替换,所以我想确定一下。
Please link to documentation!
请链接到文档!
回答by John Parker
From the iOS Application Programming Guide(see the "Files Saved During Application Updates" section within "The File System"):
来自iOS 应用程序编程指南(请参阅“文件系统”中的“应用程序更新期间保存的文件”部分):
When a user downloads an application update, iTunes installs the update in a new application directory. It then moves the user's data files from the old installation over to the new application directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:
<Application_Home>/Documents
<Application_Home>/Library
Although files in other user directories may also be moved over, you should not rely on them being present after an update.
当用户下载应用程序更新时,iTunes 会在新的应用程序目录中安装更新。然后,在删除旧安装之前,它会将用户的数据文件从旧安装移至新应用程序目录。保证在更新过程中保留以下目录中的文件:
<Application_Home>/Documents
<Application_Home>/Library
尽管其他用户目录中的文件也可能被移动,但您不应依赖更新后它们的存在。
What you're seeing in the Why isn't my iPhone app bundle replacing the old one during an update?question is an issue where Xcode doesn't correctly detect/push updated resources to the device, which is a very different scenario.
您在为什么我的 iPhone 应用程序包在更新期间没有替换旧的应用程序包?问题是 Xcode 没有正确检测/推送更新的资源到设备的问题,这是一个非常不同的场景。