Post

Replies

Boosts

Views

Activity

Reply to IAP, wrong priceLocale
I am experiencing this at the moment on tvOS 15 beta 19J5340a. When signed into a real account tied to the Spain App Store, the "priceLocale" field of a SKProduct fetched in our app is showing "GB" or Great Britain. The app is not available in the App Store in Great Britain. I am able to observe this on Testflight but it may be occurring in production as well. I have created a feedback ticket with ID FB9579894.
Topic: App & System Services SubTopic: StoreKit Tags:
Aug ’21
Reply to No screenshot files in XCResult files using Xcode 16.1
Hello OP, I have had some luck locating the files which I will share with you. In my case with Xcode 16.3 and macOS 15.4 they were stored in ~/Library/Caches/com.apple.dt.Xcode/TestReport/UUID/ExtractedAttachments/ where the UUID is an identifier corresponding to this particular build/test execution. An option to get the UUID for the most recent test run is to use ls -lrt inside that directory and the last entry would be the directory for the most recent run. I believe it is also possible to locate the UUID by parsing the plist file found in your_derived_data_folder/your_project_folder/Logs/Test/LogStoreManifest.plist as I was able to locate the same UUID present in that plist. Unfortunately, in my case, PNGs stored in this way did not retain the name property given to the XCUIAttachment as file names also consisted of UUIDs. I am working on a script to automate the process. If I succeed and the result is suitable for sharing I will share it here. I hope this helps!
Apr ’25
Reply to No screenshot files in XCResult files using Xcode 16.1
Alright I'm back and I figured it out. Here my findings as it relates to my use case of trying to get screenshots I have saved as PNG attachments during UI tests: The .xcresult bundle uses a custom storage format for attachments and other test artifacts Within the result bundle's Data subdirectory, Image data (and presumably other attachment data) is stored in files whose names appear to be base64 encoded keys prefixed with "data." These files are compressed using zstd. You can confirm this by running the file command on them. Direct decompression of these files using zstd reveals PNG image data. Hurray! As mentioned before, the filenames which are prefixed with data contain base64-encoded identifiers. The database.sqlite3 database which is present in the result bundle contains a table called Attachments which has rows for each attachment. Those rows have columns with the filename you provided the attachment in your test, as well as the encoded key which is appended to "data" to form the filename. Those column names are name and xcResultKitPayloadRefId respectively. With a little scripting you can parse the file names from the Data subdirectory, decode each file into the correct image format using zstd, look up the correct name for the file in the database using the base64 key from the original file name, and rename the newly converted PNG file accordingly. I created a script to do all of this provided the path to the .xcresult bundle and put in a public gist on GitHub: https://gist.github.com/mhk4g/a81b16b27bfcd38a5cfc21861f171e1a The script assumes PNG but you should be able to easily adapt it for other image formats. Best of luck to you!
Apr ’25
Reply to No screenshot files in XCResult files using Xcode 16.1
Hi, I made an update to the script to make use of the first party xcrun tool xcresulttool rather than relying on parsing names from the database. I saw some instances where the sqlite database did not exist until the xcresult file was interacted with, and making use of first party tools is just a better practice in general. The script now works on any type of attachment and takes an optional parameter for output directory. I have replaced the old gist, the new one is here. Cheers.
Apr ’25