472

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

23 Answers 23

1317

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!)
3
  • 48
    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.
    – pragmateek
    Commented Oct 19, 2023 at 14:58
  • 54
    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"
    – ryanpitts1
    Commented Oct 28, 2023 at 21:42
  • 5
    On macOS Sonoma, you need to delete "Xcode Caches", not "Developer Caches", as indicated by DL Studio below.
    – Hugo
    Commented Jul 23 at 13:01
443

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
  • 1
    But here I have deleted both Project Build Data and Indexes and Xcode Caches also. will this create any problem?
    – Cypher
    Commented Nov 15, 2023 at 8:11
  • 4
    After you delete Xcode Caches you can run open -a Simulator from terminal to boot up Simulator Commented Dec 9, 2023 at 14:22
217

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
  • 10
    This solved the issue but there was no need for sudo.
    – bitsmanent
    Commented Jan 22 at 10:48
  • 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. Commented Feb 19 at 10:23
  • This is the right answer since it doesn't make you clean-up you whole environment
    – zgluis
    Commented Feb 21 at 17:07
  • 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. Commented Mar 28 at 0:05
  • 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.
    – Phil
    Commented Mar 28 at 0:07
186

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

0
34
  1. Close all running iOS simulators: sudo killall Simulator
  2. Clear iOS simulator cache: rm -rf ~/Library/Developer/CoreSimulator/Caches
  3. Start iOS simulator
2
  • 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. Commented Mar 28 at 0:03
  • 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. Commented Jul 11 at 4:55
34

I am facing the same issue. So, Please follow the below instructions.

Open Terminal and Perform the below Command to remove the simulator catch.

rm -r ~/Library/Developer/CoreSimulator/Caches
1
  • 2
    Simple, thanks mate
    – Vikas Baru
    Commented Jul 12 at 8:24
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"

9

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

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

7

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!

0
4

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

2

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
  • Only needed the first one thanks, and did it via Finder to be safe
    – malhal
    Commented Mar 20 at 15:02
1

Product-> Clean Build Folder works for me!

0
1

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

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

Open Terminal and Perform below Command.

rm -r ~/Library/Developer/CoreSimulator/Caches
1

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

0

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

0

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

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
  • 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. Commented Mar 28 at 0:04
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.

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

Your Answer

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