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

Xcode 12.5.1 still slow at launching the Simulator - iPhone 11 Pro Max (iOS 14.5) but at least I can testing on Simulator

No appreciable difference in 12.5.1.

We noticed a significant performance degradation in DYLD SPI (part of Darwin Project). This causes slow launch time and application lags on every dynamic linked library load. This issue started from Big Sur 11.3. The problem is also present on iOS 14.6. I created a thread on swift.org. If you have some additional information or measurements, please, add it to the thread. Also I created a ticket at Feedback Assistant (case ID FB9349767).

We think this is fixed in Big Sur 11.6 please help verify, thx!

  • I checked Big Sur 11.6, but the issue is still present.

    But I received feedback from Apple Dev Team. They said that the issue has been resolved in macOS 12 beta 4. I checked this macOS version and confirm that debugger performance is the same as in Big Sur 11.2.1.

    iOS 15 beta 8 still reproduces this issue.

  • This is still slow for both simulator and device launch time with Xcode 13 RC, and iOS 15 RC.

Add a Comment

Hello, so I was having this problem. I had this problem and I figured out a solution for me. I am using an Apple Silicon Mac so it probably only applies to this case. I had started launching Xcode with Rosetta initially because I was suffering build issues. However, after removing this setting i've found launch speed to be MUCH quicker, and I no longer suffer from the build issues in Xcode 13.

To disable rosetta, right click on the Xcode icon and choose "Get Info", then uncheck "Open using Rosetta" and relaunch Xcode and try again. Unlikely to be the solution for everyone but hopefully it's helpful to some.

  • Can anyone from apple please provide an update on this issue? @jeremyhu 

  • This issue was fixed on Intel Mac with Mac Monterey. However it's got its way back to Rosetta on M1 MBP. Can't use Xcode without Rosetta as some of the libs still need it. Pls fix it! @jeremyhu

Add a Comment

I had the similar issue you can check my earlier post :

https://developer.apple.com/forums/thread/667454

Upgrading to Xcode 13.2.1 seems to have fixed long launch times for our macOS app !

I had been waiting for a new update of BigSur to finally fix this issue. However, I have now updated to macOS 11.6.4, and Xcode 12.4 and the extremely slow startup our our large macOS app attached to the debugger was still 8 to 10 times slower than before upgrading to 11.3.

Yesterday I decided to try Xcode 13.2.1. Our team has not officially switched to this compiler yet for but I can build and debug with a newer Xcode even though our CI computers are still using an older version of Xcode.

I was initially a little disappointed because the full build time for the our very large macOS app was slightly slower than before upgrading to BugSur 11.3 and the older Xcode. However, I can forgive that as a minor inconvenience because now launch and begin debugging almost as fast as I was before upgrading to 11.3!