511

I am running the latest macOS/Flutter/Xcode Versions using Flutter, Android Studio and Firebase. One hour ago, everything was working perfectly.

Then I rebooted my macbook and when I tried to launch an iOS simulator; I got this error:

Unable to boot the simulator

The following steps didn't fix it:

  1. Reinstall the iOS simulator
  2. Flutter clean and pub get
  3. Updating comand line tools 13.3.1 (13E500a)
  4. Run invalid cache of Android Studio

How can I fix this?

0

21 Answers 21

1427

NO NEED TO UNINSTALL XCODE!

On macOS 13 and above

  1. Go to System Settings → General → Storage → Developer
  2. Delete "Developer Caches"

On macOS 12 and below

  1. Go to About this Mac → Storage → Manage → Developer
  2. Delete all the content (no worries!)
Sign up to request clarification or add additional context in comments.

3 Comments

Anyone running macOS Sonoma 14.0, "About this Mac" > "More info..." >Developer (info icon) > Select anything that has "xcode" and "cache" in it > Click "Delete". Close all this and relaunch simulator.
I'd like to make an amendment to @pragmateek answer for users running Sonoma 14.0. Click on the Apple icon (top left) > "About this Mac" > "More info..." > "Storage Settings" > Developer (click info icon) > Select anything that has "xcode" and "cache" in it > Click "Delete". The developer info icon is in "Storage Settings"
On macOS Sonoma, you need to delete "Xcode Caches", not "Developer Caches", as indicated by DL Studio below.
471

For Mac Ventura 13.0 OS and higher -> Click apple logo on top left of your Mac

System Settings > search Storage > Developer

Then delete Xcode Caches

enter image description here

2 Comments

But here I have deleted both Project Build Data and Indexes and Xcode Caches also. will this create any problem?
After you delete Xcode Caches you can run open -a Simulator from terminal to boot up Simulator
243

For those who like to do it through the terminal.

  1. Close the simulator.
  2. In the terminal, run:
rm -R ~/Library/Developer/CoreSimulator/Caches

Or run with sudo, if it says that access denied:

sudo rm -R ~/Library/Developer/CoreSimulator/Caches
  1. Restart the simulator.

7 Comments

This solved the issue but there was no need for sudo.
This is the right answer and should be accepted. Others are about deleting development files which poses more risk of reinstalling and setting up xcode.
This is the right answer since it doesn't make you clean-up you whole environment
This only temporarilary resolves the issue, but it will return after the cache is recreated and before GateKeeper scanning completes. You're better off just waiting a few minutes. See my answer below for more specifics.
I found myself having to execute this command very often. utilizing ZSH we can use a method that can be run in the terminal without hassle and on demand. add this to your .zprofile: sh simulator_cache() { rm -R ~/Library/Developer/CoreSimulator/Caches } and run simulator_cache in your terminal when needed.
|
191

Step 1: Go to About this Mac

enter image description here

Step 2: Go to Storage enter image description here

Step 3: Delete all the content Or Delete XCode Cache

enter image description here

Comments

42
  1. Close all running iOS simulators: sudo killall Simulator
  2. Clear iOS simulator cache: rm -rf ~/Library/Developer/CoreSimulator/Caches
  3. Start iOS simulator

4 Comments

This only temporarilary resolves the issue, but it will return after the cache is recreated and before GateKeeper scanning completes. You're better off just waiting a few minutes. See my answer below for more specifics.
This is a rather generic solution to troubleshoot the iOS simulator. I'm developing .NET MAUI apps and the iOS simulator also hangs there sometimes ;-) This is the commands I have to paste into the Terminal to get the thing alive again.
Unfortunaltey a moderator deleted my answer, which is unfortunate because it means the authoratative answer on this question is getting burried and folks are being led down bad paths like uninstalling Xcode and the simulator (which actually makes the problem worse) =/
Please see my response on forums.developer.apple.com/forums/thread/132459 ... where we won't delete the answer ;)
10

Simple steps: You can just clean your Xcode Caches, and that will do the trick

  1. Open "About this Mac" from the Apple menu.
  2. Go to the "Storage" tab and click on 'manage'.
  3. Look for the "Developer" folder and open it.
  4. Inside the "Developer" folder, locate the "Xcode Caches" directory.
  5. Delete the contents of the "Xcode Caches" folder.
  6. Once the caches are cleared, try opening the Simulator again.

By following these steps, you can resolve certain issues related to the Simulator in Xcode

Comments

9

For me it was not necessary to delete XCode. I could solve it with this:

1: Click on "About this Mac" in the top left corner

2: Click on "Storage"-Tab

3: Click on "Manage"-Button

4: Click on "Developer"-Tab

5: Right click on all the data and "Delete"

Comments

9

For Mac Sonomo 14.4.1 (23E224) OS and higher -> Click the Apple logo on the top left of your Mac

System Settings > search Storage > Developer Then delete Xcode Caches

1 Comment

This worked partially for me, because I had to create a new simulator.
8

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

  2. 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 momentarily 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.

  3. If an XProtect update is installed (which happens ~weekly), that will invalidate the cached scan results for the dyld shared cache, and you will hit the issue on subsequent boots. As of the currnet version of Xcode (15.3), there is no workaround for this, but we hope to deliver one soon.

I recommend that users facing this issue please update to macOS 14.4 Beta or later and Xcode 15.3 Beta 2 or later to get the mitigations that are available.

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 because 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!

Comments

8

For Sonoma 14.3 About this Mac > Storage > Manage(Bottom right) > Developer > info icon > delete Xcode Cache then rebuild your App. Everything will work so great.

Comments

5

Open System Settings Search Storage >> Developer Delete Xcode caches, project archives and Project Build Data and Indexes

Comments

4

For me, it works by removing these folders and restarting the simulator.

Run this command on your terminal:

run rm -R ~/Library/Developer/CoreSimulator/Caches

run rm -R ~/Library/Developer/Xcode/iOS\ DeviceSupport/

run rm -R ~/Library/Developer/Xcode/DerivedData/

1 Comment

Only needed the first one thanks, and did it via Finder to be safe
1

Product-> Clean Build Folder works for me!

Comments

1

For me it worked after opening XCode and installing ios.

  1. Start XCode
  2. Open a project or create one
  3. At the Top you find the 'Runner', and the words 'Any IOS Device'. Click on the second
  4. Manage Run Destinations
  5. Simulators
  6. Push the '+'
  7. 'OS Version: Download more simulator runtimes'
  8. find iOS and click on 'GET'

Comments

1

install "DevCleaner for xcode" from app store then choose option delete old Simulator & Device Logs after this it work

Comments

1

I tried all the above issues like deleting the XCode Cache. However, I was not able to launch the simulator. What helped me:

  1. I checked the simulator in Force Quit Tab by clicking the Apple icon in the top left.
  2. I forced quit this.
  3. I closed my vs code. Then opened the vs code again, and launched the simulator. It opened.

Comments

0

In my case changing the Runner Scheme in Xcode back to Build Configuration -> Debug and Build executable -> Check the box worked. Every time I build my app on a physical device I leave this on Release and without a checked box and the simulator is not booting until returning to default setting there.

Comments

0

Uninstall Xcode and restart the Macbook device and again install Xcode, i hope the problem will be fixed.

Comments

0

After trying some of the answers here, (cleaning developer cache, updating flutter) without any success, I went to the activity monitor and killed 4 processes called "xcdevice".

After that I was finally able to normally start a new xcode device.

I hope that will help someone.

1 Comment

Killing those processes didn't actually help the situation. What solved it for you was just waiting a little while which allowed the system to complete the scan of the dyld shared cache. See my answer for more specifics.
0

I've encountered situations where the iOS simulator in Expo or React Native development becomes unresponsive. Here's a solution that often works:

1. Launch a Different Simulator:

  • Open the Simulator app on your Mac.
  • Choose a different simulator from the list (e.g., iPhone 12 mini, iPad Pro) and launch it.

This approach can sometimes "reset" the simulator environment and resolve temporary glitches that might be preventing your main simulator from working correctly.

2. Additional Tips:

  • Clear Simulator Cache (Optional): While not guaranteed, clearing the simulator cache might help in some cases. You can use tools like xcrun simctl erase <simulator_udid>. However, this approach can be time-consuming as it re-downloads the entire OS image for the simulator.

  • Restart Expo Development Server: Sometimes, restarting the Expo development server (npx expo start -c) can resolve communication issues between your project and the simulator.

Explanation:

The exact reason why launching a different simulator works isn't entirely clear. It's possible that it triggers some internal housekeeping within the simulator manager or clears temporary state that might be causing issues.

Fastlane (fastlane snapshot reset_simulators):

While I haven't personally seen any direct results when testing with fastlane for this specific scenario, it's a popular automation tool for mobile development. The command fastlane snapshot reset_simulators might potentially reset simulator state, but its effectiveness in resolving this particular issue is uncertain.

Comments

-2

Start the iOS simulator manually.

Right click on simulator and select whatever device you like, it'll automatically come to sync with flutter doctor.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.