Xcode 12 Beta - 找不到模拟器运行时

Pri*_*a22 10 xcode simulator ios xcode12

我已经安装了 Xcode 12 beta 2。我尝试在 Mac OS Catalina 上通过 Jenkins 运行我们的 xamarin 项目。它因以下错误而失败。当我从 Mac Visual Studio 构建相同的项目时,它成功了,没有任何错误。

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,_
Run Code Online (Sandbox Code Playgroud)

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

== 运行时 ==

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
Run Code Online (Sandbox Code Playgroud)

== 设备 ==

当我打开 Xcode 设置并单击“组件”->“模拟器”时,我在列表中没有看到iOS 14

谁能帮我解决这个问题?

Vla*_*rov 4

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

== 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
Run Code Online (Sandbox Code Playgroud)

但是如果我将相同的 simctl 命令由 Jenkins 作业执行,结果是

== 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)
Run Code Online (Sandbox Code Playgroud)

虽然我找不到解决方案,但我找到了解决方法。如果我阻止 Jenkins 作为启动守护进程运行并从终端手动启动它,则 Xcode beta 版本可以正常运行。

# 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
Run Code Online (Sandbox Code Playgroud)

以上所有路径均为默认路径。如果您的值恰好不同,您可能会在文件 /Library/LaunchDaemons/org.jenkins-ci.plist 中找到正确的值