2

On running a UI Test, I can see the .xcresult file generated in ~/Library/Developer/Xcode/DerivedData. I have some NSLogs in my application that I need to display as well. Does anyone know where is the path to get the application log or xcresult file?

gran_profaci
  • 8,087
  • 15
  • 66
  • 99

2 Answers2

2

The path your Xcode project's xcresult files as of Xcode 14.1 is

/Users/USER_NAME/Library/Developer/Xcode/DerivedData/APPNAME-SOME_XCODE_ID/Logs/Test/Test-SCHEME_NAME-DATE.xcresult

So if your username is gran_profaci, your app name is MyAwesomeApp, your scheme name is AwesomeScheme and you live in timezone UTC-5 your path would look something like this:

/Users/gran_profaci/Library/Developer/Xcode/DerivedData/MyAwesomeApp-aiupaskztadstnnevejnfigoiug/Logs/Test/Test-AwesomeScheme-2022.11.21_09-39-19--0500.xcresult

Each test you run will create a new xcresult file with the corresponding parameters and current date.

You can directly open the DerivedData folder from Xcode by clicking on the icon displaying a right arrow inside a circle: Xcode preferences > Locations

If you want to extract information you can use the xcparse command line tool, in your example to export the logs:

xcparse logs /path/to/Test.xcresult /path/to/exportLogFiles
Velociround
  • 611
  • 7
  • 18
-1

the path most likely appears on the terminal /Users//Documents/P/ios/build/<>/Logs/Test/Run-<.....>.xcresult

Ala'a Eng
  • 47
  • 1
  • 7
  • It seems that at least in XCode 13 everything is stored in the DerivedData folder. Can anyone confirm? I do not see any other xcresult file being generated. Moreover, XCode puts all xcresult files into one folder and names them with the date of creation, making it even harder to automate extraction with tools like xcparser. :-( – Martin Majewski Dec 02 '21 at 13:43