添加多个pod可将iOS应用程序启动时间延长10秒以上

时间:2015-06-26 18:55:26

标签: ios cocoapods

我正在使用Cocoapods 0.37.2,Xcode 6.3.2在Swift 1.2中进行iOS应用项目。在我的项目中添加大约8个pod后,应用程序启动时间在设备(iPhone 5)上大大增加(大约10秒钟)。 (注意:启动时间表示点击应用程序图标以打开应用程序的时间)

这是如此缓慢的iOS终止它,因为它没有及时发布。崩溃日志的顶部如下......

Application Specific Information: com.tryslowappswift failed to launch in time

Elapsed total CPU time (seconds): 27.720 (user 27.720, system 0.000), 68% CPU 
Elapsed application CPU time (seconds): 0.074, 0% CPU

Thread 0:
0   dyld                            0x1ff0f4c8 ImageLoaderMachOCompressed::rebase(ImageLoader::LinkContext const&) + 456
1   dyld                            0x1ff087be ImageLoader::recursiveRebase(ImageLoader::LinkContext const&) + 174
2   dyld                            0x1ff07dca ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, bool, ImageLoader::RPathChain const&) + 186
3   dyld                            0x1ff012fc dyld::link(ImageLoader*, bool, bool, ImageLoader::RPathChain const&) + 204
4   dyld                            0x1ff022d6 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2362
5   dyld                            0x1fefe222 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 394
6   dyld                            0x1fefe03c _dyld_start + 60

No thread state (register information) available
...

您可以通过以下方式测试:

注意:我创建了一个示例Swift项目,其中包含所有pod设置in my github repo。您可以在设备上克隆并运行它,看看自己的延迟。

  • application:didFinishLaunchingWithOptions:方法
  • 中创建一个新的空白项目
  • 在设备上运行应用并快速查看应用启动。
  • 停止。现在尝试添加一个Podfile,其中包含大约8个广告连播(无论广告的大小),请pod install
  • 为了清楚起见,这是我使用的Podfile ......

Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks! # required for Swift pods

pod 'Alamofire', '~> 1.2.1'
pod 'NPReachability', '~> 0.2.0'
pod 'ActionSheetPicker-3.0', '~> 1.6.1'
pod 'SDWebImage', '~> 3.7.2'
pod 'KVNProgress', '~> 2.2.1'
pod 'KeychainAccess'
pod 'JazzHands', '~> 0.2.1'
pod 'DGActivityIndicatorView'
  • 然后再次在设备上运行。这次你会注意到 10+秒延迟,甚至在调用application:didFinishLaunchingWithOptions:方法之前。没有import,没有桥接头文件,只需将pod安装到项目中就可以减慢启动速度( - 愤怒的家伙meme !!! ---)

我怀疑这与Swift 1.2有关,所以我尝试了一个Objective-C项目,但我仍然遇到同样的延迟。它似乎发生在正常的pod安装之后,我不知道如何优化或修复它。 :(

更新1(2015年7月27日):

正如Bryan Musial指出的那样,我尝试在架构设置中添加标志来记录每个库的加载时间。我在iPhone 5上运行它。这是Xcode' Devices'中的结果。窗口:

Jul 27 13:56:02 Hlung SpringBoard[43] <Warning>: Installed apps did change.
  Added: {(
  )}
  Removed: {(
  )}
  Modified: {(
      "th.in.hlung.TrySlowAppSwift"
  )}
Jul 27 13:56:03 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
   for armv7.
Jul 27 13:56:03 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: Connecting to com.apple.debugserver service...
Jul 27 13:56:03 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: Got a connection, waiting for process information for launching or attaching.
Jul 27 13:56:03 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: About to launch process for bundle ID: th.in.hlung.TrySlowAppSwift
Jul 27 13:56:03 Hlung com.apple.xpc.launchd[1] (UIKitApplication:th.in.hlung.TrySlowAppSwift[0x578b]) <Error>: The DisableASLR key is no longer respected. Please remove it.
Jul 27 13:56:03 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:04 Hlung kernel[0] <Notice>: xpcproxy[4965] Container: /private/var/mobile/Containers/Data/Application/6C097544-9C1E-4B73-ACF8-43701FDFC8C2 (sandbox)
Jul 27 13:56:04 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: In completion handler, got pid for bundle id, pid: 4965.
Jul 27 13:56:04 Hlung com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
  [4964] <Warning>: Got a connection, launched process /private/var/mobile/Containers/Bundle/Application/9F233F77-63BC-479E-827A-F08C964DE38C/TrySlowAppSwift.app (pid = 4965).
Jul 27 13:56:04 Hlung SpringBoard[43] <Warning>: LICreateIconForImage passed NULL CGImageRef image
Jul 27 13:56:04 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:04 Hlung locationd[4692] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
Jul 27 13:56:05 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:05 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:06 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:07 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:08 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:08 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:09 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:10 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:10 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:11 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:12 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung MobileMail[139] <Warning>: Attempting to badge the application icon but haven't received permission from the user to badge the application
Jul 27 13:56:12 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:13 Hlung assistant_service[4931] <Warning>: the local store doesn't allow tasks and we have no default calendar :(
Jul 27 13:56:13 Hlung assistant_service[4931] <Warning>: Error getting NanoAppRegistry workspace info: Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection to service named com.apple.nanoappregistry.workspace was invalidated.) UserInfo=0x17ebf490 {NSDebugDescription=The connection to service named com.apple.nanoappregistry.workspace was invalidated.}
Jul 27 13:56:13 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:14 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:14 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:15 Hlung amfid[4918] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: dyld: loaded: /usr/lib/libcupolicy.dylib
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: dyld: loaded: /usr/lib/libTelephonyUtilDynamic.dylib
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total time: 13.1 seconds (100.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images loaded:  149 (128 from dyld shared cache)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total segments mapped: 60, into 1700 pages with 112 pages pre-fetched
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images loading time: 12.8 seconds (97.9%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total dtrace DOF registration time: 0.17 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total rebase fixups:  32,622
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total rebase fixups time: 34.74 milliseconds (0.2%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total binding fixups: 121,320
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total binding fixups time: 116.36 milliseconds (0.8%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total weak binding fixups time: 5.10 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total bindings lazily fixed up: 0 of 0
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total initializer time: 118.97 milliseconds (0.9%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:     libSystem.B.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 37.57 milliseconds (0.2%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: libBacktraceRecording.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.77 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:        libc++.1.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.09 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:       libobjc.A.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.10 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:        CoreFoundation 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.88 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:                vImage 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.02 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:      libGLImage.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.12 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: libFosl_dynamic.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.04 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:             CoreImage 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 0.02 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>:    libswiftCore.dylib 
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: : 2.14 milliseconds (0.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total symbol trie searches:    43149
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total symbol table binary searches:    0
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images defining weak symbols:  18
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images using weak symbols:  44

最重要的部分可能就是:

Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total time: 13.1 seconds (100.0%)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images loaded:  149 (128 from dyld shared cache)
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total segments mapped: 60, into 1700 pages with 112 pages pre-fetched
Jul 27 13:56:17 Hlung TrySlowAppSwift[4965] <Notice>: total images loading time: 12.8 seconds (97.9%)

加载图片需要整整 12.8秒(97.9%)。但是这个空项目没有任何图像文件。我浏览了豆荚,我认为它们也没有大量的图像文件。我还是被困在这里。

与Bryan的结果相比,相同的代码可以在iPhone 6上运行。图像加载时间百分比也很高。

Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total time: 1.9 seconds (100.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images loaded:  148 (127 from dyld shared cache)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total segments mapped: 60, into 1756 pages with 164 pages pre-fetched
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images loading time: 1.5 seconds (81.6%)

此外,还有另一条线索。在启动屏幕期间,有多个日志行显示<Error>: SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]。谷歌搜索它只是揭示它是一些企业应用程序问题,这对我没有多大帮助。

总的来说,我仍然陷入困境。 T_T

4 个答案:

答案 0 :(得分:30)

有许多原因导致您可能正在观察缓慢的应用程序启动情况,例如内存或磁盘空间不足,越狱和/或修改设备,需要全新安装的软件更新失败,甚至硬件故障。虽然您所提供的信息还不是很多,但您可以通过一些方法来尝试消除潜在的原因。

我已经克隆了您的示例项目并在iPhone 5到iPhone 6 Plus的设备上进行了测试,虽然我无法复制您在本地观察到的缓慢行为,但我一直处于外部情况而内部因素导致启动速度缓慢。

首先,鉴于我们只有一部分崩溃日志,您应该进行一些快速验证,以确保我们正在朝着正确的调查路径前进(理想情况下,查看完整的崩溃日志会很有帮助) - 当您可能知道也可能不知道,iOS采用监督程序来确保iOS应用程序在合理的时间内做出响应。调试监视器限制时,不强制允许Xcode建立实时调试会话所需的时间。作为一个独立的应用程序启动,即在调试器之外,Watchdog限制完全有效。看看你的崩溃日志,并检查异常代码是0x8badf00d(阅读:&#34;吃坏食物&#34;) - 在64位设备上,这些代码将被前导零填充:0x000000008badf00d

通过TN2151 > Exception Codes

  

异常代码0x8badf00d表示应用程序已被iOS终止,因为发生了监视程序超时。应用程序花费太长时间来启动,终止或响应系统事件。其中一个常见原因是在主线程上进行同步网络连接。无论线程0上的操作是什么:需要移动到后台线程,或者以不同方式处理,以便它不会阻塞主线程。

正如您已经指出application:didFinishLaunchingWithOptions:在等待10秒以上之后才被击中,这表明在应用程序的引导发生时发生了延迟 - 您的崩溃日志摘录通常似乎同意。 TrySlowSwiftApp.app的线程0仅包含动态链接编辑器dyld的堆栈帧。您还需要确保您的崩溃日志指示线程0是触发崩溃的帧(我无法回想起遇到看门狗崩溃,其中线程0没有被指责,但我想这是可能的!) 。如果另一个线程被指责,那么我们需要更多地了解你手头的崩溃日志。

TN2239与大量iOS调试工具对话,并包含Environment Variables for the Dynamic Linker的一部分 - 我们希望将DYLD_PRINT_STATISTICS的值YES添加到当前运行方案中:

Xcode 6 Scheme Environment Variables Editor

我们还应该启用日志库负载&#39;在该计划的诊断编辑中:

Xcode 6 Scheme Diagnostic Editor

最后,Xcode的控制台在In-Xcode控制台中不包含时间戳信息。但是,您可以使用Xcode&#39;设备&#39;屏幕以查看带有时间戳的实时控制台:

Xcode 6 Device Console

我们添加的环境变量将为您提供有关dyld花费时间做什么的统计信息,而“日志库负载”#39; options将显示尝试加载的特定库。因为您在设备控制台中查看此信息,所以您可以看到与每个日志条目关联的时间戳。

在dyld统计信息输出中,查找设备上运行时间异常长的操作 - 供参考,这是iPhone 6上的一次加载:

Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total time: 1.9 seconds (100.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images loaded:  148 (127 from dyld shared cache)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total segments mapped: 60, into 1756 pages with 164 pages pre-fetched
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images loading time: 1.5 seconds (81.6%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total dtrace DOF registration time: 0.06 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total rebase fixups:  32,521
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total rebase fixups time: 24.03 milliseconds (1.2%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total binding fixups: 120,894
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total binding fixups time: 190.36 milliseconds (9.8%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total weak binding fixups time: 1.76 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total bindings lazily fixed up: 0 of 0
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total initializer time: 137.82 milliseconds (7.1%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:     libSystem.B.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 60.11 milliseconds (3.1%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: libBacktraceRecording.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.39 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:        libc++.1.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.27 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:       libobjc.A.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.03 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:        CoreFoundation 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 3.40 milliseconds (0.1%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:                vImage 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.31 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:      libGLImage.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.08 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: libFosl_dynamic.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.01 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:             CoreImage 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 0.57 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>:    libswiftCore.dylib 
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: : 1.74 milliseconds (0.0%)
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total symbol trie searches:    42394
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total symbol table binary searches:    0
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images defining weak symbols:  17
Jul 22 16:44:02 iPhone-6 TrySlowAppSwift[939] <Notice>: total images using weak symbols:  44

在&#39; dyld中:已加载:&#39;看看每个加载项目的时间戳 - 你正在寻找加载资源所需的时间比周围资源更长的地方。

根据您使用这些诊断工具找到的内容将有助于确定下一个诊断步骤应该是什么 - 您可以根据这些步骤收集的其他信息进行解释。

正如其他人所建议的那样,我首先要仔细检查第二个相同模型和操作系统设备上的行为 - 只是为了排除设备特定的东西。如果您可以在那里进行复制,那么您应该花更多时间进行软件调查,但是如果它没有在那里进行复制,您应该花时间来诊断受影响的设备。更激烈的诊断步骤可能涉及擦除设备和执行iOS的全新安装。如果你这样做,我会准备至少两次 - 第一次从iCloud或iTunes备份恢复并重新测试启动行为,然后重新加载第二次将内容恢复到设备。

答案 1 :(得分:2)

经过一些研究后我发现这个问题实际上不是在cocoapods中,而是在嵌入式库中(我能够用迦太基重现同样的问题)。

它不能在所有设备上重现(可能只在32位上)。此问题不会影响应用商店版本。虽然它使开发速度稍慢,但它并没有那么有害。

https://forums.developer.apple.com/message/64556#64556 https://forums.developer.apple.com/message/82399#82399

答案 2 :(得分:2)

答案 3 :(得分:0)

可能有一个Pod可以增加发射时间(在最坏的情况下会增加发射时间)。我的建议是,如果您的问题得到解决,将Pod逐个移除。也许更容易创建另一个项目来进行此测试。

如果你有一个使用-all_load链接器标志的框架或Pod,那么很有可能增加很多启动时间。