User Data is getting randomly deleted

this is an email I have sent to Apple with no luck:

Dear Apple Developer Support Team,

    I am writing to seek urgent assistance with a persistent issue I
    have been encountering with Xcode. For several months now, every
    time I connect my iPhone to Xcode for development purposes, it
    automatically overwrites the user data of my apps with an old,
    seemingly random container. This issue is severely impacting my
    ability to continue development, as I cannot test new changes
    effectively. This occurs since a few months in every iOS and
    Xcode/macOS Version. I tried it with different Apps and Devices.
    Sometimes the entire Container (Documents) gets read only access so
    no new data can be created or changed by the user. 

    I frequently used the replace container feature on Xcode so maybe
    this has something to do with it.

    This problem persists despite numerous attempts to resolve it on my
    end. I am at a critical point in my development timeline, and it is
    crucial for me to resolve this as soon as possible.

    Could you please advise on the next steps I should take to address
    this issue? If there are any logs or further information you
    require, I am more than willing to provide them.

    Thank you for your attention to this matter. I look forward to your
    prompt response and hope for a resolution soon.

    Best regards,

    Victor Lobe

Could there be a link with the bug solved in Xcode 15.4 according to release notes:

 

Resolved Issues

Fixed: In certain circumstances, an app can’t read the contents of its own data container after replacing the content of the data container using Xcode or devicectl. (116698465) (FB13253099)

@Claude31 Update: The bug still persist, regardless if the app is installed via Xcode, TestFlight or App Store. I did all the basic stuff like reinstalling, restarting the devices etc.

Update: for clarification: the App Container / Data is 80% of the time the old one, it seems like it’s a dev container that gets new loaded nearly every time I open the app. Changes in user defaults / core data don’t get saved so the data is always being resetted to the same state.

FB13800727

User Data is getting randomly deleted
 
 
Q