xcode 为什么我的 iOS 应用程序需要很长时间才能加载到我的设备上?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18984084/
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-15 03:54:17  来源:igfitidea点击:

Why is my iOS app taking a long time to load on my device?

iphoneiosobjective-cxcodeios-simulator

提问by Christos Hayward

I have an app, so far basic on technical grounds, that seems to take a long time to load. At present it displays a background image and shows 1-2 images on top of it, not much more sophisticated than a "Hello, World!" app.

我有一个应用程序,到目前为止基于技术基础,似乎需要很长时间才能加载。目前它显示一个背景图像,并在其顶部显示 1-2 个图像,并不比“Hello, World!”复杂多少。应用程序。

The status in Xcode is "Waiting for ____________: ____________'s iPhone to launch", and it stays there for several minutes before finally waiting for it to launch. This is with the device tethered to the computer. Xcode says, "No issues" to the right of that.

Xcode 中的状态是“Waiting for ____________: ____________'s iPhone to launch”,它在那里停留了几分钟,最后等待它启动。这是连接到计算机的设备。Xcode 在其右侧说“没有问题”。

The only thing I can think of that may need slimming down is several high-resolution images. I'm not doing anything particularly interesting besides displaying a shrunken version of one of them, and in the past I had what seemed like normal response times.

我能想到的唯一可能需要瘦身的是几张高分辨率图像。除了显示其中一个的缩小版本之外,我没有做任何特别有趣的事情,而且过去我的响应时间似乎很正常。

Are there any obvious causes for why a starter app should take several minutes to get up and running on an iPhone?

为什么启动应用程序需要几分钟才能在 iPhone 上启动并运行,是否有任何明显的原因?

Thanks,

谢谢,

回答by gWiz

I have 2 iPhones and one of them is behaving the same as yours. The only difference is that the "slow" one has 350 or so apps installed and the fast one is almost clean. I think this is the problem in my case. You can just reset all contents (no apps installed) just to check if it solves the problem in your case.

我有 2 部 iPhone,其中一部和你的一样。唯一的区别是“慢”的安装了 350 个左右的应用程序,而快速的几乎是干净的。我认为这就是我的问题。您可以重置所有内容(未安装应用程序)以检查它是否解决了您的问题。

回答by ipmcc

I don't know if it would account for "several minutes" but the time between compilation finishing and the app launching includes time to copy the app to the device, for the device to verify the code signature, and then for the debug server to launch, read in your whole app and start communicating with Xcode. In a large application with a lot of image resources, the time required to do these things can be quite noticeable (read: annoying as all get out.) None of those tasks needs to be done when simply launching a pre-existing, previously launched application, without a debugger.

我不知道它是否会占“几分钟”,但编译完成和应用程序启动之间的时间包括将应用程序复制到设备的时间,设备验证代码签名的时间,然后调试服务器的时间启动,阅读整个应用程序并开始与 Xcode 通信。在具有大量图像资源的大型应用程序中,执行这些操作所需的时间可能会非常明显(阅读:烦人的所有内容。)当简单地启动预先存在的、先前启动的应用程序时,不需要完成任何这些任务应用程序,无需调试器。