如何调试缓慢的应用程序启动 [英] How to debug slow app launch

查看:117
本文介绍了如何调试缓慢的应用程序启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当启动我的应用程序时,我将启动屏幕大约2-3秒,然后才会出现我的第一个UIViewController。



有些时候,我的ViewDIdAppear被调用UIViewController实际上出现了。



我有一个很大的故事板(15个屏幕)。



我有一些标志,我从UserDefaults检查(用户登录...),我初始化crashlytics和GCM。



所以标志和初始化似乎不是问题。 p>

我检查了系统时间差异,似乎还可以。



任何想要调试缓慢启动的想法?

解决方案

在Xcode中:产品 - >个人资料



时间分析器



运行此工具将为您的程序中的每个方法花费时间,并将以层次结构为您提供该信息。这应该给你一个大多数时间花费的想法。请记住,仪器会增加额外的开销,所以绝对时间值可能不正确,但是每个方法中花费的时间比例应该是您需要调试此问题。



这是一个体面的


When launching my app i get the launch screen for about 2-3 seconds and only then my first UIViewController appears.

And some times my ViewDIdAppear is being called before the UIViewController is actually appearing.

I have a pretty big storyboard (15 screens).

I have some flags that i check from UserDefaults (user is logged-in ...), and i initialize crashlytics and GCM.

So the flags and the initializing doesn't seem to be the problem.

I checked system time differences and it seems to be OK.

Any ideas for debugging the slow launch?

解决方案

In Xcode: Product -> Profile

Choose the "Time Profiler"

Running this tool will give you time spent in every method in your program, and it'll give you that information in a hierarchical structure. This should give you an idea where most of the time is spent. Keep in mind that the instrumentation adds extra overhead, so the absolute time value may not be correct, but the proportion of time spend in each method should what you need to debug this issue.

Here is a decent looking tutorial (albeit on an older version of Xcode) showing how to use this tool.

这篇关于如何调试缓慢的应用程序启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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