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.

Answered by Developer Tools Engineer in 677508022

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.

I‘m also affected by this bug on a Mac mini i7, 2020 with 16 GB RAM.

The worst thing is the slow down in UITests because I receive so many timeouts and as a consequence the tests are not reliable anymore with Xcode 12.5 on BigSur.

I switched back to Catalina, but now I can not archive my project anymore because some external swift packages are build with 12.5. Apple, please fix it soon!

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.

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.

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.

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)

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.

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.

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.

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)

Xcode 12.5 very slow launch time for app in simulator
 
 
Q