Hi,
I'm using the following command to extract information about the code coverage:
xcrun xcresulttool get --format json --path /some/path/to/xcresult
However, since Xcode 16 I get:
Error: This command is deprecated and will be removed in a future release, --legacy flag is required to use it.
But this message doesn't tell us what's the alternative to get the same result. Or are you just getting rid of useful functionality and there is no alternative?
to get the same result.
To view the format, run the following command in Terminal: xcrun xcresulttool help get test-results summary
% xcrun xcresulttool help get test-results summary
OVERVIEW: Get test report summary.
Command output structure (JSON Schema):
{
"schemas": {
"Summary": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"startTime": {
"type": "number",
"format": "double",
"description": "Date as a UNIX timestamp (seconds since midnight UTC on January 1, 1970)"
},
"finishTime": {
"type": "number",
"format": "double",
"description": "Date as a UNIX timestamp (seconds since midnight UTC on January 1, 1970)"
},
"environmentDescription": {
"type": "string",
"description": "Description of the Test Plan, OS, and environment that was used during testing"
},
"topInsights": {
"type": "array",
"items": {
"$ref": "#/schemas/InsightSummary"
}
},
"result": {
"$ref": "#/schemas/TestResult"
},
"totalTestCount": {
"type": "integer"
},
"passedTests": {
"type": "integer"
},
"failedTests": {
"type": "integer"
},
"skippedTests": {
"type": "integer"
},
"expectedFailures": {
"type": "integer"
},
"statistics": {
"type": "array",
"items": {
"$ref": "#/schemas/Statistic"
}
},
"devicesAndConfigurations": {
"$ref": "#/schemas/DeviceAndConfigurationSummary"
},
"testFailures": {
"$ref": "#/schemas/TestFailure"
}
},
"required": [
"title",
"environmentDescription",
"topInsights",
"result",
"totalTestCount",
"passedTests",
"failedTests",
"skippedTests",
"expectedFailures",
"statistics",
"devicesAndConfigurations",
"testFailures"
],
},
"InsightSummary": {
"type": "object",
"properties": {
"impact": {
"type": "string"
},
"category": {
"type" "string"
},
"text": {
"type" "string"
}
},
"required": [
"impact",
"category",
"text"
]
},
"TestResult": {
"type": "string",
"enum": [
"Passed",
"Failed",
"Skipped",
"Expected Failure",
"unknown"
]
},
"Statistic": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
}
},
"required": [
"title",
"subtitle"
]
},
"DeviceAndConfigurationSummary": {
"type": "object",
"properties": {
"device": {
"$ref": "#/schemas/Device"
},
"testPlanConfiguration": {
"$ref": "#/schemas/Configuration"
},
"passedTests": {
"type": "integer"
},
"failedTests": {
"type": "integer"
},
"skippedTests": {
"type": "integer"
},
"expectedFailures": {
"type": "integer"
}
},
"required": [
"device",
"testPlanConfiguration",
"passedTests",
"failedTests",
"skippedTests",
"expectedFailures"
]
},
"Device": {
"type": "object",
"properties": {
"deviceId": {
"type": "string"
},
"deviceName": {
"type": "string"
},
"architecture": {
"type": "string"
},
"modelName": {
"type": "string"
},
"platform": {
"type": "string"
},
"osVersion": {
"type": "string"
}
},
"required": [
"deviceName",
"architecture",
"modelName",
"osVersion"
]
},
"Configuration": {
"type": "object",
"properties": {
"configurationId": {
"type": "string"
},
"configurationName": {
"type": "string"
}
},
"required": [
"configurationId",
"configurationName"
]
},
"TestFailure": {
"type": "object",
"properties": {
"testName": {
"type": "string"
},
"targetName": {
"type": "string"
},
"failureText": {
"type": "string"
},
"testIdentifier": {
"type": "integer",
"format": "int64"
}
},
"required": [
"testName",
"targetName",
"failureText",
"testIdentifier"
]
}
}
}
USAGE: xcresulttool get test-results summary --path <path> [--compact]
OPTIONS:
--path <path> The result bundle path.
--compact Output JSON in a compact format.
--version Show the version.
-h, --help Show help information.