找不到模拟器运行时

找不到模拟器运行时

本文介绍了Xcode 12 Beta-找不到模拟器运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Xcode 12 beta2.我试图通过Mac OS Catalina上的Jenkins运行我们的xamarin项目.它失败,并显示以下错误.当我从Mac Visual Studio构建相同的项目时,它成功完成,没有任何错误.

I have installed Xcode 12 beta 2. I 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,_

我也做了xcrun simctl list来查看Xcode 12 beta的可用运行时模拟器.它显示了以下列表,但在构建时失败.

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.

==运行时==

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

==设备==

当我打开Xcode设置并点击 Components->模拟器:我在列表中没有看到 iOS 14 :

When I opened Xcode Settings and clicked to Components -> Simulator I do not see iOS 14 in the list:

有人可以帮我解决这个问题吗?

Can anyone help me to resolve this?

推荐答案

我在Jenkins上使用Xcode 12 beta构建类似的问题.当我使用jenkins用户在终端中运行 xcrun simctl list 时,我看到了

I have a similar problem building with Xcode 12 beta on Jenkins. When I run xcrun simctl list in Terminal with jenkins user, I see

== Runtimes ==
iOS 14.0 (14.0 - 18A5351d) - com.apple.CoreSimulator.SimRuntime.iOS-14-0
tvOS 14.0 (14.0 - 18J5364d) - com.apple.CoreSimulator.SimRuntime.tvOS-14-0
watchOS 7.0 (7.0 - 18R5361c) - com.apple.CoreSimulator.SimRuntime.watchOS-7-0

但是,如果我将相同的simctl命令放入Jenkins作业中,结果将是

But if I put the same simctl command to be executed by a Jenkins job, the result is

== Runtimes ==
iOS 14.0 (14.0 - 18A5351d) - com.apple.CoreSimulator.SimRuntime.iOS-14-0 (unavailable, failed to open liblaunch_sim.dylib)
tvOS 14.0 (14.0 - 18J5364d) - com.apple.CoreSimulator.SimRuntime.tvOS-14-0 (unavailable, failed to open liblaunch_sim.dylib)
watchOS 7.0 (7.0 - 18R5361c) - com.apple.CoreSimulator.SimRuntime.watchOS-7-0 (unavailable, failed to open liblaunch_sim.dylib)

尽管我找不到解决方案,但找到了解决方法.如果我停止让Jenkins作为启动守护进程运行,并从终端手动启动它,那么Xcode beta版本的运行会很好.

Although I could not find a solution, I found a workaround. If I stop Jenkins from running as a launch daemon and start it manually from the Terminal, then Xcode beta builds run fine.

# Stop Jenkins
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

# Impersonate jenkins user
sudo su - jenkins

# Tell Jenkins where its home dir is located
export JENKINS_HOME=/Users/Shared/Jenkins/Home

# Start Jenkins instance
/Library/Application\ Support/Jenkins/jenkins-runner.sh

以上所有路径均为默认路径.如果您碰巧不一样,则可以在文件/Library/LaunchDaemons/org.jenkins-ci.plist

All of the above paths are the default ones. If yours happen to be different, you may find the correct values in the file /Library/LaunchDaemons/org.jenkins-ci.plist

这篇关于Xcode 12 Beta-找不到模拟器运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 14:48