XCode 27 xcappdata is broken again

I've never had anything but trouble with xcappdata, but I got what I wanted working in the previous xcode version, I could specify the xcappdata in my testplan and it would work on the simulators.

Now, on XCode 27, the xcappdata doesn't load.

I look in the xcode 27 release notes and see there is indeed an issue with xcappdata, and a workaround.

Workaround: To make a .xcappdata bundle for use in Xcode’s Run scheme action do the following. Add .xcappdata to the folder created by Device Hub when downloading app data containers. Inside that folder make a new folder named AppData. Move the other content in that folder into AppData. For example,

com.example.MyApp/{Documents,Library,tmp}

becomes:

com.example.MyApp.xcappdata/AppData/{Documents,Library,tmp}

<endquote>

This is completely unhelpful.

When am I downloading app data containers? What folder is created by Device Hub? Where is it? How does this apply to my testplan? What if I have multiple xcappdata bundles for different test plans?

It looks to me like this workaround would be part of a script where at some magic moment I inject my app data into a simulator. Which might not be too bad

So if I wanted to build this script it I imagine it looks like

create a simulator install the app on the simulator find the folder related to the simulator copy in my xcappdata? Then I can run my tests?

I can go into device hub, and get it to show me the location of a simulator, and it opens a finder window in 'Devices' which has symlinks to the devices.

But I have no idea where that directory is.

I can find the simulators in ~/Library/Developer/CoreSimulator/Devices like before, but the directory structures don't look like the ones revealed by device hub.

So I search my mac for the same directory names as the ones in 'Devices' but they're nowhere to be found.

so even if I want to write a script, the directory locations are a total mystery.

I've made a rather horrid work around for now so I can run UITests against different installed data using a shell script, xcodebuild and simctl.

Basically I create a simulator, I run xcodebuild test with a dummy test run to install the app on the simulator, use simctl get_app_container to get the apps data container, then using cp to copy individual directories from my xcappdata into their equivalents in the data container. Finally I run xcodebuild test with my actual test plan.

This is very slow, and the shell script seems to frequently hang for a while after completing a test run.