【问题标题】:iOS Simulator video recording with 'xcrun simct' give error使用“xcrun simct”录制 iOS 模拟器视频时出现错误
【发布时间】:2016-12-20 10:28:40
【问题描述】:

查看Xcode 8.2 changes时发现现在可以使用终端录制模拟器了。

因此,我正在尝试按照此 Apple 文档中的说明从 iOS 模拟器录制视频。

Taking a Screenshot or Recording a Video Using the Command Line

命令:

xcrun simctl io booted recordVideo demoVideo.mp4

错误:

2016-12-20 15:44:27.206 simctl[6434:984477] *** Assertion failure in +[SimDisplayVideoWriter videoWriter], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-338.16/SimulatorKit/SimDisplayVideoWriter.m:48
2016-12-20 15:44:27.207 simctl[6434:984477] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create metal device for video writer.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fffa07f90db __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fffb548ba2a objc_exception_throw + 48
    2   CoreFoundation                      0x00007fffa07fdc32 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x00007fffa2266d50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   SimulatorKit                        0x000000010a248c53 +[SimDisplayVideoWriter videoWriter] + 1015
    5   SimulatorKit                        0x000000010a2499e5 +[SimDisplayVideoWriter videoWriterForURL:fileType:] + 316
    6   simctl                              0x000000010a168a00 simctl + 31232
    7   simctl                              0x000000010a166bee simctl + 23534
    8   simctl                              0x000000010a170d52 simctl + 64850
    9   libdispatch.dylib                   0x00007fffb5d3fef7 _dispatch_call_block_and_release + 12
    10  libdispatch.dylib                   0x00007fffb5d370b8 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x00007fffb5d39029 _dispatch_root_queue_drain + 917
    12  libdispatch.dylib                   0x00007fffb5d38c47 _dispatch_worker_thread3 + 99
    13  libsystem_pthread.dylib             0x00007fffb5f84712 _pthread_wqthread + 1299
    14  libsystem_pthread.dylib             0x00007fffb5f841ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

iOS 模拟器和应用程序都可以正常工作。此错误仅显示在终端中。

我正在使用 Xcode 8.2。在 iOS 10.2 的 iPhone 7、7 Plus、SE 模拟器中试用。

我是否缺少任何细节或需要安装和组件?

【问题讨论】:

  • 你用的是什么机器?
  • iMac(21.5 英寸,2011 年中)。 Mac OS Sierra (10.12.2 (16C67))
  • 视频录制路径目前需要您的硬件所没有的 Metal 支持。

标签: terminal ios-simulator xcode8.2


【解决方案1】:

仅支持 Metal 的 Mac 支持视频录制。如果您的系统不支持金属,您将看到带有该消息的中止。是的,我们应该让该错误消息对用户更友好。

要查看支持的系统列表,您可以查看https://support.apple.com/en-us/HT205073

【讨论】:

  • 感谢您的回复。您对更用户友好的消息是正确的。在“使用模拟器截图”的文档中也应该提到。
【解决方案2】:

这也在 Xcode 8.3 Beta 中得到修复:http://adcdownload.apple.com/Developer_Tools/Xcode_8.3_beta/Release_Notes_for_Xcode_8.3_beta.pdf

• xcrun 命令行工具的 simctl 工具录制的视频现在支持清理并正确导入视频编辑器。 (29654098)

我目前没有对此进行测试,但很有可能在 Xcode 的稳定版本中此错误将得到修复

【讨论】:

    猜你喜欢
    • 2018-10-19
    • 2019-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-11
    • 2011-09-12
    • 2013-09-30
    相关资源
    最近更新 更多