自从我更新到XCode 6.2后,当我尝试运行时
xcodebuild -project Demo.xcworkspace -scheme Demo clean build test
我总是得到:
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.
}
有人遇到过这种情况吗?
我不是简单地删除
/Library/Developer
目录,而是更新了 dyld_sim
所有实例的权限,以匹配 Apple 的 Jeremy 在 这篇文章 中提到的权限。首先,使用以下命令在您的计算机上查找此实例的所有实例:
sudo find / -name dyld_sim
然后,检查每一项的权限:
ls -l "<file location\file name>"
如果您没有看到:
-rwxr-xr-x 1 root wheel
然后您需要修改权限以正确匹配。就我而言,组所有权是错误的,被列为
admin
而不是 wheel
。使用
sudo chown :wheel "<file location\file name>"
更改每个不正确实例的组所有权纠正了该问题。如果问题是标志而不是所有权,您将需要使用
chmod
来代替。
在尝试运行模拟器(按照 Jeremy Huddleston Sequoia 的建议)并删除不可用的模拟器(按照普华永道的建议)后,我仍然没有得到任何爱。
Jeremy 认为这是 dyld_sim 的权限问题。所以我去寻找 dyld_sim 文件。我发现了两个,一个在 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime ...另一个在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform ...
/Library/Developer下的8.1版本是去年10月份的。面对重新安装,我决定删除 /Library/Developer/CoreSimulator 目录(其中仅包含 8.1 模拟器的配置文件)并看看发生了什么。
一切都好。 Carthage 现在可以正确构建了。
我的假设是 Xcode 构建有点迷失并拾起了旧的。所以就我而言,与权限或不可用的模拟器无关。
我在尝试运行
carthage
来构建第 3 方库时遇到了同样的问题。
我遇到的错误是:
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.}
我正在阅读苹果开发者论坛上的一个帖子,并决定检查我通过以下方式安装的模拟器:
xcrun simctl list
这样做发现很多模拟器不可用:
-- 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)
我通过以下方式删除了每个不可用的模拟器:
xcrun simctl delete [UUID]
(我复制了上面的输出并粘贴到文本编辑器中,删除了除 UUID 之外的所有内容,并在每行前面加上
xcrun simctl delete
前缀。)
这样做之后,我能够运行
carthage
,没有错误。
有完全相同的问题。我设法通过安装 Xcode 6.3.1(来自 AppStore)、在 Xcode 中打开一个项目并在模拟器上运行它来解决这个问题。
完成此操作后,我现在可以从控制台使用 xcodebuild 执行相同的操作。虽然错误从未消失,但 xcodebuild 命令现在可以工作,而不是保持阻塞状态。
sudo rm -rf /库/开发人员/*
然后我从开发者网站而不是应用程序商店下载了 XCode,并重新安装。这为我解决了这个问题。
对我来说,这个问题是由命令行开发工具冲突引起的,也是由于工具的Mac OS文件夹权限问题引起的。
我能够按照以下步骤解决它:
可选,虽然不是最好的办法,但如果您想安装多个版本的 Xcode,请确保在构建项目之前从 Xcode 首选项/位置/命令行工具激活正确的 Xcode 版本。
希望这有帮助。
如果您无法更改 dclim 文件的所有权模式,则可能是您直接从 .dmg 文件而不是安装的版本运行 Xcode 工具。 (如果是真的,Xcode 会出现在查找器中的设备标签上)
这里也有同样的问题。启动 Xcode.app 后运行 xcodebuild 解决了我的问题。 JeremyHu 在这篇文章中提到