我已经从命令行运行了单元测试,如下所示:
xcodebuild \
-resultBundlePath Example.xcresult \
-workspace Example.xcworkspace \
-scheme Example \
-destination "platform=iOS Simulator,name=iPhone 8" \
test
现在我想以JSON格式获取覆盖率报告,但是xccov失败,出现错误:无法识别的文件格式:
xcrun xccov view --json Example.xcresult
答案 0 :(得分:3)
根据Xcode 11 release notes,您还必须附加--report
,因此在您的特定示例中:
xcrun xccov view --report --json Example.xcresult
JSON
的格式将与前一种格式相同。
请参阅Honza Dvorsky(this thread)的@czechboy0