I like to write automated tests for my CloudKit code using the XCTest framework. Running a test case, gets a valid container object, gets a valid open database object, but then dies with the exception when I try to do something real:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to establish valid container/bundleID information'
What I have tried so far:
- Ive checked
Info.plist for my test purpose, and the packet id matches the container id. - I tried
[[NSBundle mainBundle] bundleIdentifier] to make sure it will return the correct package identifier. - I copied iCloud permissions from my main task.
But I still get the exception. Is there a way to get the CloudKit code running in the tests?
source share