Week 442 was posted by Charanjit Chana on 2026-04-17.
This is a note to myself, more than anything.
I've often struggled with the migration of CloudKit schemas and resource types when moving from local development to Test Flight builds. They don't populate or update correctly in the development space making it impossible to promote to production.
This time around, the fix was simple, but it was all down to a missed step from me. Let's start with the flow I had and the solution:
No schema updates in the CloudKit Console
- Develop app locally
- Run in as a Preview or in the Simulator
- Push to Test Flight
It's been a while since I've had to promote any changes to the schema so it was a surprise to me that this was an issue at all.
Getting the schema into the development environment
I had missed a crucial step in building a CloudKit-enabled app. I had to push the app to my device and create data to force the schema to be created. The workflow should have been:
- Develop app locally
- Deploy to device via Xcode
That is enough to get the schemas created, and for me it was.
Why it wasn't obvious
Couple of reasons. Firstly, I'm working with Share Extensions. I need CloudKit to sync data between the app and the extension and yet they seemed to be looking at different data stores. One of them appeared to be pointing at the right storage at least, even though both were explicitly pointed at the same one. On pushing the app to my device, they began interoperating just fine but with the Share Extension's data not the data from my app.
The second reason was that I had built my app and was close to a first release but had already incurred a load of technical debt. I took the opportunity to rename entities and to both refactor and simplify code.
Because of this rebuild, and my confidence in the code I'd written, I missed the step to deploy to my device for testing before pushing to Test Flight. Part of this was to avoid blowing away data from the earlier version of my app but once I was ready I shouldn't have skipped that step.
What to do next
Now the app is usable, I've seen a couple of bugs that need fixing. Once they're sorted, I will get the app out via Test Flight again and promoting the schemas. I've already had to make some changes as the Share Extension failed silently on some schema related information that I luckily caught in the console (after way too much hair pulling).
I'll keep pushing on and really hoping to get the first version of my new app out this month.
Tags: