{"record":{"id":"ad8382eb03dfe362","repo":"PaddlePaddle/PaddleOCR","slug":"extract-xcresult-attachments-fail-xcrun-xcresu","errorCode":null,"errorMessage":"[extract_xcresult_attachments] FAIL: `xcrun xcresulttool help get` has no `test-results` subcommand in this Xcode.\n  Where: xcrun xcresulttool help get\n  Next:  Install a newer Xcode or `xcode-select` a toolchain that ships this subcommand.","messagePattern":"\\[extract_xcresult_attachments\\] FAIL: `xcrun xcresulttool help get` has no `test-results` subcommand in this Xcode\\.\n  Where: xcrun xcresulttool help get\n  Next:  Install a newer Xcode or `xcode-select` a toolchain that ships this subcommand\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"deploy/ios_demo/scripts/extract_xcresult_attachments.py","lineNumber":78,"sourceCode":"\n\ndef _die(what: str, where: str, next_step: str, code: int = 1) -> int:\n    sys.stderr.write(\n        f\"[extract_xcresult_attachments] FAIL: {what}\\n  Where: {where}\\n  Next:  {next_step}\\n\"\n    )\n    return code\n\n\ndef _run(cmd: List[str]) -> subprocess.CompletedProcess:\n    return subprocess.run(cmd, capture_output=True, check=False)\n\n\ndef _check_xcresulttool_capability() -> None:\n    \"\"\"Require `xcrun xcresulttool help get` to list `test-results` (command exists).\"\"\"\n    r = _run([\"xcrun\", \"xcresulttool\", \"help\", \"get\"])\n    text = (r.stdout + r.stderr).decode(errors=\"replace\")\n    if \"test-results\" not in text:\n        raise SystemExit(\n            _die(\n                \"`xcrun xcresulttool help get` has no `test-results` subcommand in this Xcode.\",\n                \"xcrun xcresulttool help get\",\n                \"Install a newer Xcode or `xcode-select` a toolchain that ships this subcommand.\",\n            )\n        )\n\n\ndef _load_tests_json(result_path: Path) -> dict:\n    r = _run(\n        [\n            \"xcrun\",\n            \"xcresulttool\",\n            \"get\",\n            \"test-results\",\n            \"tests\",\n            \"--path\",\n            str(result_path),","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/deploy/ios_demo/scripts/extract_xcresult_attachments.py#L60-L96","documentation":"Raised by extract_xcresult_attachments.py during its capability probe: it runs `xcrun xcresulttool help get` and requires the output to mention the `test-results` subcommand. Older Xcode toolchains (pre-Xcode 16) ship an xcresulttool without that subcommand, so the script exits immediately with a pointer to the probe command and a remediation hint.","triggerScenarios":"Running the script on a machine whose selected Xcode (via xcode-select) predates the `xcresulttool get test-results` interface; having a CommandLineTools-only install selected instead of full Xcode.","commonSituations":"CI runners pinned to an older Xcode; a developer whose xcode-select points at CommandLineTools after a macOS upgrade; a new machine where the newest Xcode was installed but never selected.","solutions":["sudo xcode-select -s /Applications/Xcode.app (or the path to an Xcode 16+ install), then re-run.","Install a newer Xcode from the App Store or developer downloads if none is present.","Confirm the capability first: `xcrun xcresulttool help get` should list test-results."],"exampleFix":"# before\nxcode-select -p\n# /Library/Developer/CommandLineTools\npython deploy/ios_demo/scripts/extract_xcresult_attachments.py result.xcresult\n# -> SystemExit: no `test-results` subcommand\n\n# after\nsudo xcode-select -s /Applications/Xcode.app\npython deploy/ios_demo/scripts/extract_xcresult_attachments.py result.xcresult","handlingStrategy":"validation","validationCode":"import subprocess\n\ndef xcresulttool_capable() -> bool:\n    r = subprocess.run(\n        [\"xcrun\", \"xcresulttool\", \"help\", \"get\"],\n        capture_output=True,\n    )\n    return b\"test-results\" in (r.stdout + r.stderr)\n\nif not xcresulttool_capable():\n    raise SystemExit(\"select Xcode 16+: sudo xcode-select -s /Applications/Xcode.app\")","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.run(\n        [sys.executable, \"deploy/ios_demo/scripts/extract_xcresult_attachments.py\", path],\n        check=True,\n    )\nexcept subprocess.CalledProcessError as e:\n    if \"test-results\" in (e.stderr or \"\"):\n        print(\"fix: sudo xcode-select -s /Applications/Xcode.app\")\n    raise","preventionTips":["Check `xcode-select -p` and xcresulttool capability in CI setup steps.","Pin CI to an Xcode version that ships `xcresulttool get test-results`.","Document the minimum Xcode version wherever the extraction script is used."],"tags":["paddleocr","ios","xcode","xcresulttool","toolchain"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}