1

As stated, any way of retrieving App Logs, not just the test logs, using Xcode 14? all I see in xcresult files are the Runner's logs, but I need the app logs as well both when running via Xcode or through cli

1 Answer 1

1

Xcode 15

Third-party tools

You can also use some third-party helpers like xcparse, and XCResultExtractor (thanks @CMash).

Native tools

On Xcode 15 Reveal Diagnostics in Finder context menu is gone, which seems VERY ODD. I'm currently facing the same problem as described in this Apple dev forum thread and I opened a Feeback Report FB13615178.

In the meantime, you can use xcresulttool via CLI.

Get the object graph to get the IDs for the objects you want to export.

xcrun xcresulttool graph --path YourResult.xcresult/ > graph.log

Search for StandardOutputAndStandardError to see where it is in the graph. Get its ID and export it:

xcrun xcresulttool export \
--type directory \
--path YourResult.xcresult/ \
--output-path ./Output \
--id <ID-HERE>

I believe we can put together a script to automatically extract the logs on a CI environment - this is our current goal. Please share if you have any progress.

Xcode 14

Open the .xcresult in Xcode, right-click a test, and select Reveal Diagnostics in Finder. You should see your simulator(s) folder(s) and inside one of those you'll see StandardOutputAndStandardError-bundle-id.txt file.

3
  • 1
    "I'm having this problem too" is not a valid answer.
    – matt
    Commented Feb 13 at 17:02
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question.
    – AztecCodes
    Commented Feb 15 at 11:40
  • Thanks for this @henrique, hopefully you've already put your own script together but if you haven't you're welcome to use or look at mine! github.com/ChrisMash/XCResultExtractor
    – CMash
    Commented Apr 25 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.