Xcode 12 very slow to launch simulator

Viewed 1082

Someone could help me ?

I have a problem with Xcode 12.4, the application takes more than 5 minutes to launch the app and stay blocked building the app.

It's not a problem with my application because i have tried with the new app and the problem still be the same.

1 Answers

TL;DR

Run once and wait for the Simulator home screen to load. After loaded, re-run the app from Xcode. ‍♂️

Explanation

I am not sure if this will actually fix the issue, but usually, I fully open the Simulator.app for that device and wait for the Home screen to load before running the app. I think Springboard (Xcode) waits to get a handshake response when the device has fully launched and then attaches the process. This handshake was a bottleneck for me.

Other potential causes

  1. Disable Springboard injection apps like Sherlock.app.
  2. Reduce the number of simulators open at a given time to increase available RAM.
  3. Reduce the number of open apps so that Xcode gets more CPU time to run.
  4. Disable Debug executable setting (or other runtime settings) in Edit Scheme in Xcode to check if the Xcode debugger is faulty (workaround).
  5. Try a newer Mac (2017 or later, but ideally an M1) as they have more RAM and are faster.
  6. Reduce App Bundle size - smaller Asset Catalogs, Preview Content folders, fewer third-party libraries, and no duplicate source files (including the iCloud Desktop/Document Sync zombie files bug).
  7. Disable iCloud Desktop and Documents Folder syncing. Or at least wait till the whole laptop has been synced. The bird daemons et al. are quite intensive.
Related