xcodebuild corrupts test result output when output redirected to file

前端 未结 2 1032
心在旅途
心在旅途 2021-02-05 20:48

I have Jenkins with the Xcode plugin configured to run unit tests by adding the test build action to the Custom xcodebuild arguments setting. For more information on getting Jen

相关标签:
2条回答
  • 2021-02-05 20:59

    Thanks to this answer, I discovered a way to essentially disable buffering using the script command.

    script -q -t 0 xcodebuild.out \
        xcodebuild \
            -workspace project.xcworkspace \
            -scheme Tests \
            -configuration Release \
            -sdk iphonesimulator7.0 \
            -destination "platform=iOS Simulator,name=iPhone Retina (4-inch),OS=latest" \
            test
    cat xcodebuild.out
    
    0 讨论(0)
  • 2021-02-05 21:07

    As noted by Malte in a comment above, a cleaner solution might be

        env NSUnbufferedIO=YES xcodebuild ...
    
    0 讨论(0)
提交回复
热议问题