xcode 代码=53 “模拟器验证失败。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29411058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:54:32  来源:igfitidea点击:

Code=53 "Simulator verification failed."

iosxcodexcodebuild

提问by marius bardan

Since I updated to XCode 6.2, when I try to run

自从我更新到 XCode 6.2 后,当我尝试运行时

xcodebuild -project Demo.xcworkspace -scheme Demo clean build test

I'm always getting:

我总是得到:

iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 
"Simulator verification failed." UserInfo=0x7f82b9e091a0 
{
    NSLocalizedFailureReason=A connection to the simulator verification service could
    not be established., 

    NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with 
    ownership enabled., 

    NSLocalizedDescription=Simulator verification failed.
}

Has anyone encountered this?

有没有人遇到过这个?

Screenshot

截屏

回答by Michael McGuire

Rather than simply delete the /Library/Developerdirectory, I updated the permissions on all instances of dyld_simto match those that Jeremy from Apple mentions in this post. First, find all instances of this on your machine with the following command:

/Library/Developer我不是简单地删除目录,而是更新了所有实例的权限,dyld_sim以匹配 Apple 的 Jeremy 在这篇文章中提到的那些。首先,使用以下命令在您的机器上找到所有实例:

sudo find / -name dyld_sim

Then, check the permissions for each one:

然后,检查每个权限:

ls -l "<file location\file name>"

If you don't see:

如果您没有看到:

-rwxr-xr-x  1 root  wheel  

Then you will need to modify the permissions to match properly. In my case, the group ownership was wrong and listed as admininstead of wheel. Using

然后您需要修改权限以正确匹配。就我而言,组所有权是错误的,并列为admin而不是wheel。使用

sudo chown :wheel "<file location\file name>"

to change the group ownership on each of the incorrect instances corrected the issue. If the issue is the flags and not ownership you will need to use chmodinstead.

更改每个不正确实例的组所有权更正了该问题。如果问题是标志而不是所有权,则需要chmod改用。

回答by Kevin

After trying both running the simulator (as suggested by Jeremy Huddleston Sequoia) and removing the unavailable simulators (as suggested by pwc) I still was getting no love.

在尝试运行模拟器(按照 Jeremy Huddleston Sequoia 的建议)和删除不可用的模拟器(按照普华永道的建议)之后,我仍然没有得到任何爱。

Jeremy suggested it was a permissions issue with dyld_sim. So I went looking for dyld_sim files. I found two, one in /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime ... the other inside /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform ...

Jeremy 认为这是 dyld_sim 的权限问题。所以我去寻找 dyld_sim 文件。我找到了两个,一个在 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime ...另一个在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform ...

The 8.1 version under /Library/Developer was from October last year. Facing a reinstall I decided to remove the /Library/Developer/CoreSimulator directory(which only contained a profile for the 8.1 simulator) and see what happened.

/Library/Developer 下的 8.1 版本是去年 10 月的。面对重新安装,我决定删除 /Library/Developer/CoreSimulator 目录(其中仅包含 8.1 模拟器的配置文件)并查看发生了什么。

All good. Carthage now build correctly for me.

都好。迦太基现在为我正确构建。

My assumption is that Xcode build was getting a little lost and picking up the old one. SO nothing to do with permissions or unavailable simulators in my case.

我的假设是 Xcode 构建有点丢失并捡起了旧的。所以在我的情况下与权限或不可用的模拟器无关。

回答by pwc

I was running into the same issue when trying to run carthageto build a 3rd-party library.

我在尝试运行carthage以构建 3rd 方库时遇到了同样的问题。

The error I was getting was:

我得到的错误是:

2015-04-22 02:16:17.468 xcodebuild[944:9962] [MT] iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed." UserInfo=0x7ffb237cf260 {NSLocalizedFailureReason=A connection to the simulator verification service could not be established., NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled., NSLocalizedDescription=Simulator verification failed.}

I was reading a thread on the Apple Developer Forumand decided to check the simulators I had installed via:

我正在阅读Apple Developer Forum 上的一个帖子,并决定通过以下方式检查我安装的模拟器:

xcrun simctl list

Doing so found a lot of simulators that were unavailable:

这样做发现了很多不可用的模拟器:

-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-8-0 --
    iPhone 4s (E4B99ABA-C455-4579-AFB6-9FFE4D7B2D9B) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5 (F4C1E6D1-102A-4E49-B8CB-6274258C8E55) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5s (33C6AA80-EA85-41E8-928D-38598B87BBCB) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (293C225D-02C8-4458-BAEE-0F5ED76E308E) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (C93CCB55-1DFB-4452-876D-663A8E85CBB8) (Shutdown) (unavailable, runtime profile not found)
    iPad 2 (DFC56B19-82F4-4587-95F5-E53154681689) (Shutdown) (unavailable, runtime profile not found)
    iPad Retina (AC5F3C69-9554-4A0A-84A7-81C586E7F0EC) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (BD6C1EEB-9BCE-47BF-AC80-BD1AEFC61E06) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPhone (37FBC485-B844-42DE-B77D-02995176E057) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPad (B45EC16E-DB4D-4B0E-B969-90F468B673DA) (Shutdown) (unavailable, runtime profile not found)

I deleted each of the unavailable simulators via:

我通过以下方式删除了每个不可用的模拟器:

xcrun simctl delete [UUID]

(I copied that output from above and pasted into a text editor, deleted everything but the UUIDs, and prefixed each line with xcrun simctl delete.)

(我从上面复制了该输出并粘贴到文本编辑器中,删除了除 UUID 之外的所有内容,并在每行前加上xcrun simctl delete.)

After doing that, I was able to run carthagewithout error.

这样做之后,我能够毫无错误地运行carthage

回答by Mihai Damian

Had the exact same problem. I managed to fix this by installing Xcode 6.3.1 (from AppStore), opening a project in Xcode and running it on the simulator.

有完全相同的问题。我设法通过安装 Xcode 6.3.1(来自 AppStore)、在 Xcode 中打开一个项目并在模拟器上运行它来解决这个问题。

After doing this I am now able to do the same using xcodebuild from the console. The error never went away though, but xcodebuild commands now work instead of remaining blocked.

完成此操作后,我现在可以从控制台使用 xcodebuild 执行相同操作。虽然错误从未消失,但 xcodebuild 命令现在可以工作而不是保持阻塞状态。

回答by Denis

Solution by @kevinoneill from https://github.com/Carthage/Carthage/issues/424helped me. Just removed the /Library/Developer/CoreSimulator/ folder and no Xcode re-install was required anymore.

@kevinoneill 来自https://github.com/Carthage/Carthage/issues/424 的解决方案帮助了我。刚刚删除了 /Library/Developer/CoreSimulator/ 文件夹,不再需要重新安装 Xcode。

回答by Jeremy Huddleston Sequoia

Run iOS Simulator.app, and it will connect to the verification service and fix ownership and permissions on dyld_sim such that xcodebuild doesn't need to.

运行 iOS Simulator.app,它将连接到验证服务并修复 dyld_sim 上的所有权和权限,这样 xcodebuild 就不需要了。

回答by spfursich

sudo rm -rf /Library/Developer/*

sudo rm -rf /库/开发人员/*

I then downloaded XCode from the developer website, instead of the app store, and reinstalled. This fixed the issue for me.

然后我从开发者网站而不是应用商店下载了 XCode,然后重新安装。这为我解决了这个问题。

回答by Yonathan W'Gebriel

For me, this problem was caused by conflict of command-line development tools and also due to Mac OS folder permission issues with the tools.

对我来说,这个问题是由命令行开发工具的冲突以及工具的 Mac OS 文件夹权限问题引起的。

I was able to resolve it following these steps:

我能够按照以下步骤解决它:

  1. Quit any running instances of Xcode, Instruments and iOS simulators
  2. Removing the developer folder: /Library/Developer
  3. Remove all your Xcode installations: /Applications/Xcode.app,...
  4. Reboot your Mac
  5. Download Xcode.dmg from Apple Developer Portal (NOTfrom the App Store)
  6. Reinstall Xcode
  7. Launch Xcode
  1. 退出任何正在运行的 Xcode、Instruments 和 iOS 模拟器实例
  2. 删除开发者文件夹:/Library/Developer
  3. 删除所有 Xcode 安装:/Applications/Xcode.app,...
  4. 重新启动你的 Mac
  5. 从 Apple Developer Portal(不是从 App Store)下载 Xcode.dmg
  6. 重新安装Xcode
  7. 启动 Xcode

Optionally, though not the best thing to do, if you wanna install multiple versions of Xcode, make sure you activate the right Xcode version from Xcode Preferences/Locations/Command-Line Tools, before building your projects.

或者,虽然不是最好的做法,但如果您想安装多个版本的 Xcode,请确保在构建项目之前从Xcode Preferences/Locations/Command-Line Tools激活正确的 Xcode 版本。

Hope this helps.

希望这可以帮助。

回答by Simon Berton

Go to the folder where you have your project and do the following: chmod -R 777 ionic_test.

转到项目所在的文件夹并执行以下操作:chmod -R 777 ionic_test。

the problem is that you have root permission and xcode won't load files without permission.

问题是你有 root 权限,xcode 不会在没有权限的情况下加载文件。

回答by b.zdybowicz

If you can't change ownership mode for dclim files it may be happening that you are running Xcode tools directly from .dmg file instead of installed version. (If it is true Xcode appears on devices tag in finder)

如果您无法更改 dclim 文件的所有权模式,则可能是您直接从 .dmg 文件而不是已安装版本运行 Xcode 工具。(如果是真的 Xcode 出现在 finder 的设备标签上)