I released an iOS + Mac Catalyst app that uses Core Data and NSPersistentCloudKitContainer.
No issues for the users, but something is wrong for me when installing the app from the Mac App Store: it not only uses the development database instead of the production database, but also merged both (I think it loaded the dev one from local storage and imported the prod one from iCloud).
I once had something similar on iOS too but it was easy to fix: delete the app installed by Xcode or TestFlight, then install via App Store.
However, I can't find a solution for macOS. I've deleted the app's folder in ~/Library/Containers and deleted the app from /Applications but after re-installing from the App Store, it happens again.
What can I do to fix this?
Note that I've found this answer but it's not exactly the same - in my case the released app is using the development database instead of the production database on macOS, so I can't do the "if DEBUG" thing (unless I first clean everything maybe and do this for the next version?).