Skip to content

Instantly share code, notes, and snippets.

@mael
Last active May 23, 2024 10:01
Show Gist options
  • Save mael/e3d9cd77a43347091d5c3894ce4e22c7 to your computer and use it in GitHub Desktop.
Save mael/e3d9cd77a43347091d5c3894ce4e22c7 to your computer and use it in GitHub Desktop.
Xcode 10.2 "Unable to boot the Simulator"

Solution "Unable to boot the Simulator"

sudo mkdir /private/tmp

sudo chmod 1777 /private/tmp

Other basic command

xcrun

xcrun simctl list devices //to list all simulators

xcrun simctl delete // to delete specific device

xcrun simctl delete unavailable // to remove old devices for runtimes that are no longer supported

Delete and clean

xcrun simctl shutdown all

xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}' | xargs)

xcrun simctl delete unavailable

xcode

sudo xcode-select --reset

To delete devices go here:

~/Library/Developer/CoreSimulator/Devices

Simulator

Defautl open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/

Launch multiple simulators

find simulator id’s from the ‘xcrun simctl list’ command

xcrun simctl boot 12F3C6FB-1A8A-4D20-922F-2DB485F58F0F

xcrun simctl boot BE53CBFF-4900-4F10-A1D4-B451AB4C9E7E

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/

From Xcode project

  1. Go to Window > Devices and Simulators, delete all the simulators, all of them.
  2. Clear /Library/Developer/CoreSimulator/ folder.
  3. Return to Xcode and install the required simulators.
@zachnicoll
Copy link

Legendary, this helped me after updating XCode. Thanks!

@kvntzn
Copy link

kvntzn commented May 16, 2022

It works Thanks !

@mdrideout
Copy link

If all this still fails, it may be because you are trying to use simulator directly from the Simulator app. Instead try running an app from xcode and let xcode boot the simulator that way.

@ahmedalani
Copy link

let's go! This worked 🚀 Thanks!

@Rockncoder
Copy link

Does anyone know what causes this issue?

@jitin-qub
Copy link

This is awesome. Thanks

@TheBlindHawk
Copy link

TheBlindHawk commented Aug 19, 2022

This didn't work for me, as the issue seemed to be with the chached files.
I tried the following instead:
About This Mac -> Storage -> Manage -> Developer
And deleted all the contents there
(found the solution here, it's in Japanese tho)

@Saroopashree
Copy link

@TheBlindHawk Thanks, this method worked! 🚀

@karthik-durai
Copy link

@TheBlindHawk thanks, it worked

@NguyenManh1404
Copy link

Xcode 15 chỉ build được trên simulators với ver IOS nhỏ hơn 17(Cụ thể là 16.4) :)

@Rafik-Belkadi-malou
Copy link

Thanks it worked !

@MAgungHKM
Copy link

+1 works for me too!

@jeremyhu
Copy link

Deleting caches should not be necessary here. I expect that will just cause the issue to recur later.

There are a few causes we've identified for this issue:

  1. The dyld_sim shared cache fails to map into a process within the watchdog timer because it was just recently created and is still being scanned by the system. Deleting the cache will momentarilary address this problem, but you would hit it again the next time the cache is created. Waiting ~2 minutes should allow the scan to complete. Additionally, if you update to Xcode 15.3 Beta 2 or later (released last week), we now avoid attempting to use the cache until that scan is complete.

  2. There is a performance issue reading from the simulator runtime disk images which can result in boot triggering that watchdog timer, especially if I/O is competing with the process that is generating the dyld shared cache. This performance issue has been addressed in macOS 14.4 Beta and later.

As such, I reccomend that users facing this issue please update to macOS 14.4 Beta or later and Xcode 15.3 Beta 2 or later. If you still see this issue, please collect the following tarballs and attach them to a report at http://bugreport.apple.com:
xcrun simctl diagnose
sudo sysdiagnose

Also, if you're able, please enable debug logging via:
defaults write com.apple.CoreSimulator DebugLogging -bool YES

(you can remove the debug logging later with defaults delete com.apple.CoreSimulator DebugLogging)

Note that we've had multiple reports of this issue over the past 6 months, but triage has been difficult in part becuase we have not been getting the logging requested above and by the time the reporter gets around to responding to the request, they are out of the problematic state (because it usually resolves on its own in a few minutes). Please do not assume that someone else is providing the data. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment