Bitrise上漂亮而智能的Xcode存档步骤日志

标准日志中包含最后10行经过修饰的Xcode日志,以使在 Bitrise 上的调试更加流畅

在我们的Xcode构建步骤中,我们使用xcpretty修饰原始Xcode构建日志的输出。 原始日志存储在一个临时目录中,因此,如果要详细检查故障,则可以找到原始输出。

尽管xcpretty产生了更多易于消化的输出,但是很常见的是,您无法从经过修饰的输出中分辨出确切的错误,但是它包含在原始Xcode构建日志的末尾。 因此,我们更新了Xcode步骤,以在步骤失败且输出工具为xcpretty时,将构建日志的最后10行打印到标准输出中。 这与完整日志无关,该文件仍然可用。

新的日志看起来很漂亮。 😉

 ▸ Check Dependencies ❌ Code signing is required for product type 'Application' in SDK 'iOS 10.3' 
❌ Code signing is required for product type 'Application' in SDK 'iOS 10.3'
[33;1mIf you can't find the reason of the error in the log, please check the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path
is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable[0m
[31;1mArchive failed, error: exit status 65[0m

+---+---------------------------------------------------------------+----------+
[31;1mx[0m
[31;1mxcode-archive@2.4.2 (exit code: 1)[0m
19 sec
+---+---------------------------------------------------------------+----------+
Issue tracker: https://github.com/bitrise-io/steps-xcode-archive/issues
Source: https://github.com/bitrise-io/steps-xcode-archive
+---+---------------------------------------------------------------+----------+

原始日志的结尾看起来像这样:

 Check dependencies 
Signing for "Ngenic Tune" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)

快乐美化!


最初发布在 Bitrise博客上