Skip to content

Instantly share code, notes, and snippets.

@rayray
Created August 15, 2023 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayray/5f75fdca3612ddbbd3d7b3b7c759c266 to your computer and use it in GitHub Desktop.
Save rayray/5f75fdca3612ddbbd3d7b3b7c759c266 to your computer and use it in GitHub Desktop.
extract diagnostics folder from an xcresult
#!/bin/bash
# Raymond Edwards
# extract diagnostics folder from an xcresult. this script assumes jq is installed
# if Diagnostics/ already exists, xcresulttool will overwrite it
XCRESULT="${1}"
DIAGNOSTICS_ID=$(xcrun xcresulttool get --format json --path "${XCRESULT}" | jq -r '."actions"."_values"[0]."actionResult"."diagnosticsRef"."id"."_value"')
echo "Dumping xcresult diagnostic data into Diagnostics/"
xcrun xcresulttool export --type directory --output-path Diagnostics --path "${XCRESULT}" --id "${DIAGNOSTICS_ID}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment