我可以使用xcodebuild test命令运行XCTests .但是,当我运行此命令时,它会输出构建日志,然后在结尾处有来自测试的日志.有没有办法我只能将测试输出(无构建日志)重定向到单独的文件?
我在xcodebuild命令中找不到任何东西.
关心开发
Gar*_*ord 11
您可以使用ocunit2junit https://github.com/ciryon/OCUnit2JUnit将构建日志输出解析为junit xml以与Jenkins一起使用.这也适用于XCTest.
xcodebuild test -scheme "MyScheme" -destination "platform=iOS,id=UDID_OF_DEVICE" -derivedDataPath "$(pwd)" 2>&1 | tee out.txt
cat out.txt | tools/ocunit2junit
Run Code Online (Sandbox Code Playgroud)
默认情况下,这会将junit xml输出到测试报告.如果你不想要junit xml那么你仍然可以使用ocunit2junit作为解析构建输出的参考.