Xcode 12 Beta Simulator Runtime not available

I installed Xcode 12 beta 2 and tried to run our xamarin project through Jenkins on Mac OS Catalina. It fails with the below error. When i build the same project from Mac Visual studio, it succeeded without any error.

SplashViewController.storyboard : error : iOS 14.0 (14.0 - 18A5319g) - com.apple.CoreSimulator.SimRuntime.iOS-14-0 (unavailable, failed to open liblaunchsim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The iOS 14.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The iOS 14.0 simulator runtime is not available., NSUnderlyingError=0x7fef8847b520 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff97d649a0> { count = 1, transaction: 0, voucher = 0x0,_

I also did 'xcrun simctl list' to view the available runtime simulators for Xcode 12 beta.
it shows the below list but fails while building.

== Runtimes ==

iOS 14.0 (14.0 - 18A5319g) -
com.apple.CoreSimulator.SimRuntime.iOS-14-0

tvOS 14.0 (14.0 - 18J5331g) -
com.apple.CoreSimulator.SimRuntime.tvOS-14-0

watchOS 7.0 (7.0 - 18R5327h) -
com.apple.CoreSimulator.SimRuntime.watchOS-7-0

== Devices ==

Can anyone help me to resolve this.

Thanks in advance.

Replies

We are having a similar error, any advice from others would be appreciated
The same to me.

xcodebuild archive  through Jenkins got errors:
  1. CompileStoryboard /Users/build0/tempbaidurepo_1598946043/.easybox/checkouts/Widget/Widget/Resources/MainInterface.storyboard

Code Block language
[2020-09-01 15:44:37] 2020-09-01 15:44:14.926 ibtoold[15466:184721312] [MT] IBPlatformTool: * Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7feb54c67280> System content for IBCocoaTouchFramework-EightAndLater <IBScaleFactorDeviceTypeDescription: 0x7feb54c63760> scaleFactor=2x, renderMode.identifier=(null): Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x7feb54c67280> System content for IBCocoaTouchFramework-EightAndLater <IBScaleFactorDeviceTypeDescription: 0x7feb54c63760> scaleFactor=2x, renderMode.identifier=(null)'.
[2020-09-01 15:44:37] Device type: IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x)
[2020-09-01 15:44:37] Sim runtime: (null)
[2020-09-01 15:44:37] Please also include the output of `xcrun simctl list` and `xcode-select -p`.: Failed to find newest available Simulator runtime: No available runtime found from: [
[2020-09-01 15:44:37] watchOS 7.0 (7.0 - 18R5310a) - com.apple.CoreSimulator.SimRuntime.watchOS-7-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The watchOS 7.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The watchOS 7.0 simulator runtime is not available., NSUnderlyingError=0x7feb64f3c2d0 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff8e8749a0> { count = 1, transaction: 0, voucher = 0x0, contents =
...


2. CompileAssetCatalog /Users/build1/tempbaidurepo1598946088/build/Build/Intermediates.noindex/ArchiveIntermediates/BaiduBoxApp/InstallationBuildProductsLocation/Applications/BaiduBoxApp.app /Users/build1/tempbaidurepo1598946088/BaiduBoxApp/Resources/Images.xcassets

Code Block language
/* com.apple.actool.errors */
[2020-09-01 15:48:05] /Users/build1/temp_baidu_repo_1598946088/BaiduBoxApp/Resources/Images.xcassets: error: Failed to find newest available Simulator runtime
[2020-09-01 15:48:05] Underlying Errors:
[2020-09-01 15:48:05] Description: No available runtime found from: [
[2020-09-01 15:48:05] watchOS 7.0 (7.0 - 18R5310a) - com.apple.CoreSimulator.SimRuntime.watchOS-7-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The watchOS 7.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The watchOS 7.0 simulator runtime is not available., NSUnderlyingError=0x7fca23c58df0 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff8e8749a0> { count = 1, transaction: 0, voucher = 0x0, contents =
[2020-09-01 15:48:05] "XPCErrorDescription" => <string: 0x7fff8e874b08> { length = 18, contents = "Connection invalid" }
[2020-09-01 15:48:05] }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib},
[2020-09-01 15:48:05] tvOS 14.0 (14.0 - 18J5313t) - com.apple.CoreSimulator.SimRuntime.tvOS-14-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The tvOS 14.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The tvOS 14.0 simulator runtime is not available., NSUnderlyingError=0x7fc994270970 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff8e8749a0> { count = 1, transaction: 0, voucher = 0x0, contents =
[2020-09-01 15:48:05] "XPCErrorDescription" => <string: 0x7fff8e874b08> { length = 18, contents = "Connection invalid" }
[2020-09-01 15:48:05] }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib},
[2020-09-01 15:48:05] iOS 14.0 (14.0 - 18A5301v) - com.apple.CoreSimulator.SimRuntime.iOS-14-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The iOS 14.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The iOS 14.0 simulator runtime is not available., NSUnderlyingError=0x7fca25a8a6d0 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff8e8749a0> { count = 1, transaction: 0, voucher = 0x0, contents =
[2020-09-01 15:48:05] "XPCErrorDescription" => <string: 0x7fff8e874b08> { length = 18, contents = "Connection invalid" }
[2020-09-01 15:48:05] }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib},
[2020-09-01 15:48:05] ] when matching for <IBCocoaTouchPlatformToolDescription: 0x7fc99426ed90> System content for IBCocoaTouchFramework-ThirteenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fc99426eb20> scaleFactor=2x, renderMode.identifier=(null), idiom=<IBIPhoneIdiom: 0x7fc9e3eac0b0> runtime=<IBCocoaTouchTargetRuntime: 0x7fca23c80220>




I've seen this as well, however we can only reproduce the problem on macOS machines that have had Xcode 11 installed before installing the Xcode 12 beta. I setup a new mac mini the other day with a clean OS install and Xcode 12 beta 6 and the issue did not appear.
Also having this problem.

Running Xcode in terminal shows this:

Code Block bash
xcrun simctl list
...
iOS 14.0 (14.0 - 18A5301v) - com.apple.CoreSimulator.SimRuntime.iOS-14-0 (unavailable, failed to open liblaunch_sim.dylib)


I did accidentally install Xcode 11, which according to the other poster may have something to do with it. I'll investigate later.

Waiting for Beta 6 to download so I can install it, that may fix the issue.

Confirming that updating Xcode 12 to Beta 6 fixes the issue. I have Xcode Simulator working fine now!
I'm having the same problem on my Mac mini Jenkins CI/CD server. Here's my environment:
  • macOS Catalina 10.15.6

  • Jenkins 2.257

  • Xcode 12 (12A7209) - downloaded from the App Store

  • fastlane 2.160 - for automating all the things around build, testing, deployment etc.

When I run a build from inside Jenkins, it fails with the above error. When I ssh into the machine, fetch from github and run a build via fastlane directly everything runs through. I stumbled across this stackoverflow post where workaround is posted, but looks like a bad hack for me and can only be a temporary solution.

What is the root cause of this problem? Why aren't the simulator environments available in a Jenkins job environment?
Same issue is happening for me also. I would really appreciate if anyone found a proper fix for that.
I worked around this issue by starting Jenkins as LaunchAgent instead of a LaunchDeamon, similar to the solution posted in this stackoverflow post. That way it runs as a real user and everything works as expected.

There is one caveat with this solution! The jenkins user has to be logged in. I needed to turn on Automatic login for the jenkins user on my Mac mini. That's not great, but at least I can use my build server again.

If someone needs more details of my solution, just leave a message here and I will post some more details.
Code Block bash
sudo xcrun simctl shutdown all && sudo xcrun simctl erase all

fixed our jenkins server.
Same problem here when building on Jenkins CI.
The jenkins node is launched through a launchd daemon.

/Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist
Code Block plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.jenkins-ci.node.jnlp</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Users/user/jenkins/node.jnlp.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>SessionCreate</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/user/jenkins/org.jenkins-ci.node.jnlp.stdout.log</string>
<key>StandardOutPath</key>
<string>/Users/user/jenkins/org.jenkins-ci.node.jnlp.stderr.log</string>
<key>UserName</key>
<string>user</string>
<key>WorkingDirectory</key>
<string>/Users/user/jenkins</string>
</dict>
</plist>


Loading this as root gives us the failure as previous posters (Unable to open liblaunch_sim.dylib):
Code Block sh
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist


But instead loading without sudo when running as the user specified by UserName everything passes:
Code Block sh
launchctl load /Library/LaunchDaemons/org.jenkins-ci.node.jnlp.plist


Though my understanding is that the UserName key will run the script as the same user as my second example.
I just don't have enough understanding of launchd to figure out how to solve the issue...


I have the exact same problem since update to Xcode 12 and can confirm the behavior "anders.u" is describing: starting the Jenkins daemon in user context let Jenkins build my app successfully. But when using sudo (or loading the daemon automatically during startup) the build always fails with "failed to open liblaunch_sim.dylib".

There must be something which is available in user context only. I have no idea what it could be.

I'm looking for a solution or workaround urgently. Loggin in as the local user automatically after boot and start the daemon is a security hole.
zhangziqi's answer worked for me, which fixed our Jenkins server. I tried many solutions, but only this one worked.

Code Block sh
sudo xcrun simctl shutdown all && sudo xcrun simctl erase all


sudo xcrun simctl shutdown all

temporary works for me, after some time of inactivity (no CI jobs on vm) the errors pops right back and I need to manually run the same code again.

Has anybody found a concrete solution?
I'm seeing this issue on Xcode 12 - Xcode 12.2 running on travis.ci. Has anyone logged a bug report to Apple about this?
I'm assuming that this "Known Issue" from Xcode 12.2 release notes is the same as the issue we are discussing here.


Known Issues
Simulators may not be available when running command-line tools like simctl or xcodebuild from a non-root LaunchDaemon, or when launching as a different user from the current user (for example, with sudo or launchctl). (62188195)

https://developer.apple.com/documentation/xcode-release-notes/xcode-12_2-release-notes