我在GitHub上安装了Travis CI。我用它来检查我对iOS应用程序的提交。问题是,我经常随机得到错误65.我还没有找到解决方案。
当我在失败后重新开始工作2-3次时,它会在90%的时间内完成。
我以前也遇到了Travis(> 4MB)日志过于冗长的问题,但我添加了xcpretty
来解决这个问题。
我从日志中获取的错误:
...
Generating 'XYZ.app.dSYM'
❌ error: couldn't remove '/Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app/SomeName.storyboardc' after command failed: Directory not empty
...
然后在特拉维斯日志结束时:
Testing failed:
The file “056-Jj-FAu-view-XmS-Ro-0cO.nib” couldn’t be opened because there is no such file.
error: couldn't remove '/Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app/SomeName.storyboardc' after command failed: Directory not empty
error: lipo: can't move temporary file: /Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app.dSYM/Contents/Resources/DWARF/XYZ to file: /Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app.dSYM/Contents/Resources/DWARF/XYZ.lipo (No such file or directory)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil emitted errors but did not return a nonzero exit code to indicate failure
** TEST FAILED **
The following build commands failed:
LinkStoryboards
LinkStoryboards
(2 failures)
The command "./scripts/build.sh" exited with 65.
我在Xcode和Travis设置中都使用Xcode 8
。
答案 0 :(得分:1)
啊,好问题。有时,xcodebuild
可以使用travis_retry
解决在代码签名步骤中失败的docker save myimage > myimage.tar
步骤 - Travis将针对任何非零退出状态重试该步骤3次,这将减少您重新启动它的需要手动。 travis-ci/travis-ci
GitHub issue上也有一些建议的代码片段。祝好运!
答案 1 :(得分:1)
如果您遇到错误代码65(来自随机失败)这里的命令,您可以管道xcodebuild
的末尾(假设您正在运行测试)命令要获得更一致的结果:
(XCODEBUILD_COMMAND_HERE) | awk 'BEGIN {success=0} $0 ~ /.* tests, with 0 failures \(.*/ {success=1} {print $0} END {if(success==0){exit 1}}
这会在输出文本中查找tests, with 0 failures (
,因此使用xcodebuild
的文本输出而不是xcodebuild
的状态代码来确定成功。
注意:请注意,如果您在代码中执行类似NSLog(' tests, with 0 failures (');
的操作,则会产生误报,但这种情况不太可能发生。您可能必须在tests, with 0 failures (
的更新之间更新awk脚本中的xcodebuild
。但是,与xcodebuild
保持一致的结果肯定是值得的。