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.

Can confirm - huge improvement on Xcode 12.5.1.

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).

@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.

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

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).

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.

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!

Xcode 12.5 very slow launch time for app in simulator
 
 
Q