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

Have you specifically confirmed this is still happening with Xcode 15.4? The bug here is actually in Xcode (not iOS), but it should be fixed as of Xcode 15.4 (15F31d) and I can't see the Xcode version from the iOS sysdiagnose.

-Kevin Elliott
DTS Engineer, CoreOS/Hardware

Are there any updates? I stopped development because of this bug and my app needs a serious security update.

We fixed another container problem in Xcode 16.0b1. Quoting the Xcode 16 Beta Release Notes:

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)

Regarding FB13800727, we believe that’s related to a bug in the system, not Xcode. That’s not fixed in the current iOS 18.0b1 seed )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

User Data is getting randomly deleted
 
 
Q