xcrun xcresulttool --formatDescription
показывает, что существует ключ logRef с уникальным значением, указывающим на журнал, который мы можем запросить, если знаем идентификатор элемента.
Используя jq, я смог выполнить эту задачу.
Сначала мы получаем идентификатор logRef
, затем извлекаем его значение из пакета .xcresult
в текстовый файл.
# find the id that points to the location of the encoded file in the .xcresult bundle
id=$(xcrun xcresulttool get --format json --path Tests.xcresult | jq '.actions._values[]' | jq -r '.actionResult.logRef.id._value')
# export the log found at the the id in the .xcresult bundle
xcrun xcresulttool export --path Tests.xcresult --id $id --output-path TestsStdErrorStdout.log --type file