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 Reply

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?

Replies

I'm also seeing this problem, but have noticed a couple of other factors which I haven't seen here yet:

  1. Running xcode simctl list takes >3.5min to give results. This is only the case with xcrun simctl commands. Other xcrun commands seem to launch in a timely fashion.
  2. Rebooting the system will give you a few minutes in which to run normally. Wait too long and the problem presents itself again.

Can someone having this issue verify xcrun simctl list is also a problem for them? This is causing my React-Native Detox tests to time out because it can't get any of the xcrun simctl commands to come back before a 3 minute timeout. Manually increasing that timeout allows the Detox tests to succeed, but they take over an hour to complete where they would take < 2 minutes before.

  • xcrun simctl list works fine for me (Big Sur 11.4 and Xcode 12.5)

  • works fine (Big Sur 11.4 and Xcode 12.5)

Add a Comment

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?

Could you clarify what when running on newer versions of macOS available in Xcode 13 Beta, available today. means?

Do we have to update both Xcode and macOS?

Is there any workaround to fix the issue on Xcode 12? The performance issue is major and unfortunately not everyone can jump to the latest version of Xcode right away.

  • Exactly. Using beta version Xcode is not really a good fix...

Add a Comment

Xcode 13 Beta seems to have addressed this issue. Having installed it, I can actually run my UI tests again in Xcode 12 as well.

Xcode 13 Beta does not solve it for me. Still really slow (BigSur 11.5 Beta 2)

  • Xcode 13 Beta does not solve the issue here either on BigSur 11.4

    1.5 seconds to clear splash screen when launched from Springboard (no Xcode) 58 seconds to clear splash screen when launched from Xcode 12.4 56 seconds to clear splash screen when launched from Xcode 13 Beta 1

Add a Comment

I'm having the same issue and it's massively affecting my productivity. Is there anything we can do? Using Xcode 13 is not a viable solution.

Post not yet marked as solved Up vote reply of KK7 Down vote reply of KK7

For me, passing to macOS 12 beta, solve the problem. Launching time returned to normal. Unhappily I can stay on 12 beta, because there are too much problems to work with.

13b1 is definitely much faster for me. I'm going to try using it day-to-day, and then revert to 12.5 for builds to submit.

Can someone from apple (@jeremyhu) please give an update on this? This is a HUGE performance hit to our automation tests.

This needs to be solved for Xcode 12, immediately. We can't be waiting minutes at a time for an app to launch, either on device or in the Simulator. And we can't ship apps with Xcode 13 beta.

Seems Xcode 12.5.1 has largely fixed it. I've been using it for 3 hours it's improved from 15 seconds frozen to 3 seconds frozen post launch.

So initially, I didn't see any improvement in Xcode 12.5.1 - notably the iPhone 12 Pro simulator was still hanging for around 15 seconds before my app UI became responsive.

However, erasing all contents and settings in that simulator seems to have restored performance to normal. I thought I'd tried this before so maybe something has improved.

  • 👍 Thanks for the feedback!

Add a Comment

Xcode 12.5.1 seems to have fixed the issue for me: the first build and run took 30+seconds to attach, however the second and third build and run attached after around 3 seconds.

Post not yet marked as solved Up vote reply of Pat Down vote reply of Pat
  • 👍 Thanks for the feedback!

  • Can confirm. macOS 10.14 and Xcode 12.5.1. The first run took a long time, and subsequent runs are fast.

Add a Comment

For me, 12.5.1 doesn't fix the slow debug speed. I redo my tests/measure again, but with ne Xcode 12.5.1 release. I didn't see any improvements at all: On the test machine macOS 11.2.1 with Xcode 12.5.1, Starting application in debug took 25s. macOS 11.4 with Xcode 12.5.1, it take between 85s to 135s (3.5 to 6 time slower)

Can confirm - huge improvement on Xcode 12.5.1.