How can I count the time it takes from the moment the user presses the launch button on the home screen until the moment the app is active (for example, until the viewDidAppear
You can go to edit scheme on Xcode and add a environment variable (DYLD_PRINT_STATISTICS = 1) as shown in the image
When you run the app the details will be printed on debugger output as below:
Total pre-main time: 481.88 milliseconds (100.0%)
dylib loading time: 71.70 milliseconds (14.8%)
rebase/binding time: 53.66 milliseconds (11.1%)
ObjC setup time: 40.04 milliseconds (8.3%)
initializer time: 316.33 milliseconds (65.6%)
slowest intializers :
libSystem.B.dylib : 16.71 milliseconds (3.4%)
Please watch the video for more details.