Xcode 12.5 very slow launch time for app in simulator

Configuration
  • Big Sur 11.3

  • Xcode 12.5

(recently updated from Catalina and Xcode 12.4)

Problem
When running app in iOS 14.5 simulator launch takes incredibly long time (more than 30 seconds). In comparison launching installed app in simulator - 2 seconds, launching app on the real device (iOS 14.4) - 6 seconds.

Additional information
When running against simulator Xcode says "launching app", "attaching to app", and then "running app", at the running app stage we get a ~30 second pause. debugserver at 100% activity at that time.

Looking for solution
Methods described here https://developer.apple.com/forums/thread/651012 (deleting the contents of ~/Library/Developer/Xcode/iOS DeviceSupport) didn't help.
If I untick Debug Executable for the scheme app starts normally but then logically debugging isn't possible so it's not a solution.

  • The problem seems to be related to Big Sur 11.3 and Big Sur 11.4. Not to specific Xcode version (Xcode 12.4 got about the same results that 12.5).

    I do some measures for 2 applications in debug on Big Sur 11.1 and Big Sur 11.4. Here the launch time results: App1 - Big Sur 11.1 = 0m21s - Big Sur 11.4 = 1m20s App2 - Big Sur 11.1 = 0m31s - Big Sur 11.4 = 5m08s

    Conclusion: Debugging Application on 11.4 is between 4 to 10 time slower than 11.1.

    Note App2 have nearly 100 dylib to load while App1 have only 30.

  • @oldnpoor I am using Big Sur, but my build always fails with the Build input cannot be found. Here If I removed the product name in the build settings, Build got succeeded. But the app was not installed because the .app file was not available in the Build input file cannot be found: '/Users/name/Library/Developer/Xcode/DerivedData/App-dhdivlzaazbnhtguhlgnkkglsibo/Build/Products/Debug-iphonesimulator/Hello App.app/Hello App. Could you please let me know any workarounds.

  • Upgrading to macOS 11.6 helped somewhat - after a brief evaluation, debugging seems doable now with "only" 15-30 second pauses. Better than the several minutes observed with 11.3 but still a horrible developer experience (small project size with a few dependencies).

Add a Comment

Accepted Answer

As others have noticed, this issue was triggered by updating a newer versions of macOS. We have a change to address this performance issue when running on newer versions of macOS available in Xcode 13 Beta, available today.

  • 👍 Thank you very much for the update!!

  • @jeremyhu Do you plan to update Xcode 12.5 with this fix? I am unable to use Xcode 13.

  • @jeremyhu Could you please clarify what the users are asking? From many reasons, development will continue on Xcode 12.5 for a couple of months for many users. When will Xcode 12.6 be released with the change addressing the performance issue?

Answers

There’s a thread about this on Twitter too - but looks like I can’t share links to Twitter here. Someone has created a radar too: FB9091473
Post not yet marked as solved Up vote reply of Pat Down vote reply of Pat
The problem is connected with updating to Big Sur 11.3
The issue seems to be tied to having many libraries that are not part of the shared cache. That slows down dyld (it's shipped with the OS, not xcode) in unproportional way. I hope Apple will soon come up with the solution.
  • I skipped Big Sur 11.3 or 11.4 and updated directly to 11.5.2 last night. I then updated my Xcode to 12.5.1. The simulator (I chose iPhone 11) for an existing small project then took more than 10 minutes (!!!) to launch and run! (I have a 2017 iMac 27".) When will Apple fix this?!

Add a Comment
As @OlKir1143 said the problem it's with Big Sur 11.3, because my team mates have the same xcode version (12.5) and the problem doesn't exist. I tried everything deleting developer, deleting simulators deleted xcode, everything.
Same here. Slow launch time in iOS 14.5 Simulator and Big Sur 11.3. But everything is normal when the app runs to real device.
This also happens when running older Versions of Xcode on Big Sur 11.3, e.g. using the iOS 14.4 sim. Very annoying....
Apple just released macOS Big Sur 11.3.1 today. Let's see if Apple already fixed this problem.
Update to 11.3.1 and it's the same, can anyone confirm? On the first run after the update, xcode requested to install command line tools now i'm having new errors ex: "Class CSAudioFileManager is implemented in both". I know what is this and i didn't had before update. I think the problem it's related to this log: nw_protocol_get_quic_image_block_invoke dlopen libquic failed.
Because after this log the app it's launched
I can confirm that I am still experiencing this issue after updating to macOS Big Sur 11.3.1. Tested on iMac Pro.
Just updated to macOS Big Sur 11.3.1 and still have the problem. Anyone using macOS Big Sur 11.4 Beta? Today Apple just release the Beta 2 of macOS 11.4
Add a Comment
I have the same problem in 11.4 beta 2. Started with 11.3. Not better with 11.3.1
The slow down in Debugger launch times can be even worse for large macOS applications. It now takes ten times longer to startup our application after upgrading to BigSur 11.3 (and 11.3.1).

Previously, the splash screen was visible almost immediately; however, it could take another minute or so to load the hundreds of dylibs, frameworks and plugin bundles to complete the application's initialization.

With this slower dyld in macOS 11.3 (and 11.3.1), the application takes over a minute before the splash screen is displayed and another 9 or 10 minutes to finish loading all the components. (This is using an iMacPro 2017, 2.5 GHz 14-Core Intel Xeon with 64GB.)

The bundles in particular are now loading very slowly. Every time I break into the debugger the top of the stack looks like this:
Code Block
Main Thread (1) Queue : com.apple.main-thread (serial)
#0 0x00000001183fb532 in _dyld_debugger_notification ()
#1 0x00000001183fa6bb in gdb_image_notifier(dyld_image_mode, unsigned int, dyld_image_info const*) ()
#2 0x00000001183fa3af in notifyGDB(dyld_image_states, unsigned int, dyld_image_info const*) ()
#3 0x00000001183ecf51 in dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) ()
#4 0x00000001183fc5a9 in ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, bool, ImageLoader::RPathChain const&, char const*) ()
#5 0x00000001183ed519 in dyld::link(ImageLoader*, bool, bool, ImageLoader::RPathChain const&, unsigned int) ()
#6 0x00000001183f8d63 in dlopen_internal ()
#7 0x00007fff20626c94 in dlopen_internal(char const*, int, void*) ()
#8 0x00007fff2061507e in dlopen ()
#9 0x00007fff20728534 in _CFBundleDlfcnLoadBundle ()
#10 0x00007fff207a18da in _CFBundleLoadExecutableAndReturnError ()
#11 0x00007fff2076932a in CFBundleGetFunctionPointerForName ()

At the moment it is not cost effective to build and test our application on macOS 11.3 or 11.3.1.

Hopefully Apple will have a fix this Debug performance issue asap.




  • @tramsdell Your post was 3 months ago. I just updated to Big Sur 11.5.2 and Xcode 12.5.1 and the problem remains the same! :-(

Add a Comment
Same here - what the heck is going on - the opposite of productivity.

If I untick Debug Executable for the scheme app starts normally but then logically debugging isn't possible so it's not a solution.

Actually, I tried that with some limited success. With that box unchecked: my app launches quickly; and I can at least see the console log statements in real time.

As I've noticed me and my colleague experiencing the same behaviour on Xcode 12,5 - extremely slow debugger it takes time to po. Also we are having a black screen on launch for some seconds 10-20 and then the app launches what the hell. Apple please fix this asap thanks!
If this is impacting your productivity take a moment to create a radar or duplicate the one mentioned by @Pat, it is likely that it will get fixed sooner.