xcrun xcresulttool Failed to create a new result bundle reader

I need to read results of a test in Xcode post-action of Test.

So the script that runs after tests contains

SUMMARY=$(xcrun xcresulttool get test-results summary --path $RESULT_FILE 2>> "$LOGS")

If I run my script from terminal, everything is ok but if I launch tests and the post-action is executed, I got

Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT
Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_VERSION
Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT
Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_VERSION
Error: Failed to create a new result bundle reader, underlying error: failed to read metadata with underlying error (type: FileSystemError: 3 - [:] - The operation couldn’t be completed. (MinimalTSCBasic.FileSystemError error 3.)
Usage: xcresulttool <subcommand>
  See 'xcresulttool --help' for more information.

It might be that the environment set by Xcode is missing something but I cannot figure out what, any idea?

What version of Xcode reproduces this issue?

To find out what version of Xcode is being used by your tools, run the following command in Terminal:

xcode-select --print-path

I get the same annoying warnings since Xcode 16. Currently seeing them under 16.1.

Not only do I see it in scripts being executed as an Xcode Archive post action, but also in other scripts on my compputer.

Don't know if it is related, but since then DSYM info for Sentry is also broken.

Path is:

/Applications/Xcode.app/Contents/Developer
xcrun xcresulttool Failed to create a new result bundle reader
 
 
Q