Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing iCloud sync with a single iOS device

I have just one iOS device at the moment, and it hasn't been a problem so far. But I now want to add iCloud sync support to my app (which uses Core Data).

Will testing be simply impossible until I get a second device? Or is it possible to use iOS Simulator in conjunction with my device or to fake iCloud data in order to test iCloud sync?

Edit: It doesn't take much research to find that iCloud, especially with Core Data, definitely requires extensive testing and that certainly means testing with more than one device!

like image 911
Clafou Avatar asked Sep 09 '12 09:09

Clafou


People also ask

How do I check iCloud sync?

Tap Settings > [your name] > iCloud > Manage Storage, which will list how much iCloud storage you're using and which apps are eating up the most storage. To automatically back up your device each day, turn on iCloud Backup via Settings > [your name] > iCloud > iCloud Backup and toggle iCloud Backup to on.

How often does iCloud sync across devices?

These are backups Apple makes of all apps and data on a device once per day. Restore your phone using iCloud device backups which will keep your Day One data intact (text and photos) and all your preferences preserved. These are automatic backups made once per day to your iCloud account.

How does iCloud sync across devices?

Simply select the “Automatically sync when this [device] is connected” checkbox in the General pane, then turn on syncing for each type of content you want to sync. Your Mac and iPhone, iPad, or iPod touch update to matching content whenever you connect them.


2 Answers

In Xcode 5:

OS Simulator now supports iCloud syncing of documents and KVS data within an app, enabling apps to sync between devices using iCloud. This feature is useful when testing to ensure that the app documents and data are syncing properly across multiple devices.

Note: With the app running in the iOS Simulator, sign in to an Apple ID account using the Settings app. After signing in, use the “Trigger iCloud sync” command in the Debug menu to tell the simulator to sync with other devices.

like image 184
sash Avatar answered Nov 15 '22 12:11

sash


You could use your mac as the second device and take the backend of your iOS core data code and write a test app for the mac. You will have to run the app as a sandboxed app in xcode and put the same sandbox name in the app settings for the apps to see each others data.

To make this work you need to create a mac app up on the provisioning portal (requires a mac developer license 99 bucks - cheaper than an iOS device) and enable it for iCloud.

In general unless you are going to try and manage merge conflicts in your app, you dont need to test iCloud itself. Anything that is in the ubiquity container will in fact be synced. If you need transactional control across devices (same documents being updated on multiple devices at the same time for the same user, you would have to handle conflicts), depending on what your app does it might be an issue.

like image 22
deleted_user Avatar answered Nov 15 '22 12:11

deleted_user