I am adding iCloud with Core Data to an app that already exists in the app store, so I need to test upgrade scenarios. However, when I delete my app from my device and re-install it from Xcode, I have noticed that everything inside of my ubiquity container folder on the device is persisted! This is incredibly annoying, as iCloud ends up getting confused when trying to upload files from the transaction logs directory I have specified and often times out. I end up needing to specify a new transaction log location to get it to work again, which will obviously not work in the future for my testing.
The following is the error I receive:
PFUbiquitySafeSaveFile waitForFileToUpload:: CoreData: Ubiquity: (0) permanentLocation: : /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~appnamegoeshere/DatabaseTransactionLogs/mobile.8A0C3F8A-4077-57D7-8250-6BE15D1BCD20/iCloudData/8u0BfiCwOkHHa~o8hF4bunW~zmdS_C8om5efuugxRaA=/receipt.0.cdt safeLocation: : /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~appnamegoeshere/DatabaseTransactionLogs/mobile.8A0C3F8A-4077-57D7-8250-6BE15D1BCD20/iCloudData/8u0BfiCwOkHHa~o8hF4bunW~zmdS_C8om5efuugxRaA=/mobile.8A0C3F8A-4077-57D7-8250-6BE15D1BCD20.0.cdt currentLocation: : /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~appnamegoeshere/DatabaseTransactionLogs/mobile.8A0C3F8A-4077-57D7-8250-6BE15D1BCD20/iCloudData/8u0BfiCwOkHHa~o8hF4bunW~zmdS_C8om5efuugxRaA=/mobile.8A0C3F8A-4077-57D7-8250-6BE15D1BCD20.0.cdt
kv: (null)
Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 "The file upload timed out." UserInfo=0x1e5b6b10 {NSLocalizedDescription=The file upload timed out.}
Does anyone know how to clear out a ubiquity container between app installs? Even removing the ubiquity container from the app settings and republishing it does not fix this issue. A customer in theory would be able to hit this issue just by deleting the app and then deleting their iCloud files for it. This issue has been really frustrating to determine what the cause of the issue is - any suggestions are appreciated!