dyld环境变量DYLD_PRINT_STATISTICS无法显示

由于启动优化 苹果iOS10开始 提供dyld环境变量DYLD_PRINT_STATISTICS DYLD_PRINT_STATISTICS_DETAILS在控制台输出pre-main的耗时

Xcode~>Edit Scheme>Run>Arguments~>Environments Variables

dyld变量设置scheme

相应设置的控制打印
控制台打印信息:
DYLD_PRINT_STATISTICS:
Total pre-main time: 118.37 milliseconds (100.0%)
         dylib loading time: 130.14 milliseconds (109.9%)
        rebase/binding time: 411015771.6 seconds (344882902.8%)
            ObjC setup time:   2.30 milliseconds (1.9%)
           initializer time:  18.32 milliseconds (15.4%)
           slowest intializers :
             libSystem.B.dylib :   1.83 milliseconds (1.5%)
   libBacktraceRecording.dylib :   4.11 milliseconds (3.4%)
    libMainThreadChecker.dylib :  10.32 milliseconds (8.7%)

DYLD_PRINT_STATISTICS_DETAILS:
  total time: 307.55 milliseconds (100.0%)
  total images loaded:  341 (334 from dyld shared cache)
  total segments mapped: 21, into 419 pages
  total images loading time: 241.59 milliseconds (78.5%)
  total load time in ObjC:   2.30 milliseconds (0.7%)
  total debugger pause time: 111.44 milliseconds (36.2%)
  total dtrace DOF registration time:   0.00 milliseconds (0.0%)
  total rebase fixups:  16,207
  total rebase fixups time:   0.29 milliseconds (0.0%)
  total binding fixups: 491,959
  total binding fixups time:  45.02 milliseconds (14.6%)
  total weak binding fixups time:   0.01 milliseconds (0.0%)
  total redo shared cached bindings time:  77.73 milliseconds (25.2%)
  total bindings lazily fixed up: 0 of 0
  total time in initializers and ObjC +load:  18.32 milliseconds (5.9%)
                         libSystem.B.dylib :   1.83 milliseconds (0.5%)
               libBacktraceRecording.dylib :   4.11 milliseconds (1.3%)
                           libobjc.A.dylib :   0.45 milliseconds (0.1%)
                            CoreFoundation :   0.38 milliseconds (0.1%)
                libMainThreadChecker.dylib :  10.32 milliseconds (3.3%)
                    libLLVMContainer.dylib :   0.44 milliseconds (0.1%)
total symbol trie searches:    1147056
total symbol table binary searches:    0
total images defining weak symbols:  33
total images using weak symbols:  89
但是升级Xcode13 iOS15时,控制台打印就没了

原因是其它只适配iOS10 - iOS14,如需要查看可以使用相关系统内的手机、模拟机。
(测试环境:Xcode15 模拟器iOS13.0 / iOS14.0.1 / iOS14.5)

你可能感兴趣的:(dyld环境变量DYLD_PRINT_STATISTICS无法显示)