How to debug slow app launch

前端 未结 2 1290
失恋的感觉
失恋的感觉 2021-01-14 11:16

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

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 11:32

    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.

提交回复
热议问题