I was trying to run iOS 15 Simulator on Xcode 15.0.1, but I got an error: "Unable to boot the Simulator. Interrupted system call"
I tried:
- Reinstalling Xcode
- Deleted "Derived Data"
- Redownloaded iOS 15 runtime
None of the above methods works for me.
Here is the error log:
Domain: NSPOSIXErrorDomain
Code: 4
Failure Reason: Interrupted system call
User Info: {
DVTErrorCreationDateKey = "2023-10-26 16:42:13 +0000";
IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";
Session = "com.apple.CoreSimulator.SimDevice.AA0321E3-E8C1-4B8D-A650-6078D711A67E";
}
--
Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding
Domain: com.apple.SimLaunchHostService.RequestError
Code: 4
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone13,1";
"device_osBuild" = "15.0 (19A339)";
"device_platform" = "com.apple.platform.iphonesimulator";
"dvt_coredevice_version" = "348.1";
"dvt_mobiledevice_version" = "1643.2.4";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 213;
"operation_errorCode" = 4;
"operation_errorDomain" = NSPOSIXErrorDomain;
"operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker";
"operation_name" = IDERunOperationWorkerGroup;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphonesimulator";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_structuredConsoleMode" = 1;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator17.0";
"sdk_osVersion" = "17.0";
"sdk_variant" = iphonesimulator;
}
--
System Information
macOS Version 14.0 (Build 23A344)
Xcode 15.0.1 (22266) (Build 15A507)
Timestamp: 2023-10-27T00:42:13+08:00
As you can see I’m running Xcode on my MacBook Pro 16 (M1 Max) with macOS Sonoma
2
Answers
Okay, answering my own question, after trying thousands of methods I've finally fixed it:
sudo chmod 1777 /tmp
dyld
folder in this path:~/Library/Developer/CoreSimulator
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:
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.
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!