Search code examples
xcodeinstrumentsxcode-instruments

XCode Instruments can't open .trace file: The file couldn't be opened because there is not such file


I shared .trace file that I created with XCode 12.5 Instruments and sent it to the other developers to analyze but they can not open it because of next error:

The file couldn't be opened because there is not such file

I don't have this file on my mac and don't know how to find it but I can open my file successfully.

How to share a .trace file?


Solution

  • You can find 0B463CA7-E796-4DB1-B46B-EEBE0B1664E7 file from inside your .trace file.

    1. Open your_file.trace (i.e. 'Show Package Contents' in Finder)
    2. Unzip your_file.trace/shared_data/1.run/0B463CA7-E796-4DB1-B46B-EEBE0B1664E7.zip
    3. Then you can find the second your_file.trace in the unzipped folder e.g.: Users/user/Downloads/your_file.trace
    4. Open the second .trace file and find 0B463CA7-E796-4DB1-B46B-EEBE0B1664E7 e.g: your_file.trace/shared_data/1.run/0B463CA7-E796-4DB1-B46B-EEBE0B1664E7
    5. Copy 0B463CA7-E796-4DB1-B46B-EEBE0B1664E7 file to your_file.trace/shared_data/1.run of your root .trace file.

    As a result you must have both 0B463CA7-E796-4DB1-B46B-EEBE0B1664E7 and 0B463CA7-E796-4DB1-B46B-EEBE0B1664E7.zip at the same location inside your .trace file and now it is available to open anywhere.

    If you open this file on your mac steps to unzip and find this file are made automatically by Instruments because the zip file have a folder structure that points to your user but this doesn't work for an other user so may be it's a bug of Instruments.