Uploading to iCloud Photo Library and checking its progress

The first thing that happens when you turn on iCloud Photo Library on your iOS device or Mac is that all your photos and videos in the Photos app get uploaded to iCloud. Depending on the size of your photo library and your Internet connection, this can take a long time to complete.

My iPhone had around 1,500 items between photos and videos. Uploading those to iCloud Photo Library took some days to complete. While the uploading is happening, in the Photos app, at the bottom of the Moments view—not in Collections or Years views—you get an indication of the progress with the number of items still to upload. This number seems to decrease in groups of 20 or 40—instead of one by one—making it appear as if the progress is stuck, which is particularly noticeable when a video in your library is being uploaded.

But the majority of my photos are in the Photos Library on my Mac—which as I write this is still uploading—with over 10,000 photos and close to 350 videos, ranging from low quality photos of small size, to RAW files from DSLR cameras and videos of many lengths. In total, Finder reports the size of the Photos Library on my Mac to be 105 GB. Like Photos for iOS, the Photos app for Mac also reports the progress of the upload at the bottom of the Moments view, showing the number of items—photos and videos—still to upload, their total size, and how much of that total size has been uploaded. For example, it will show something like "Uploading 7,162 Items (2.07 GB of 33.92 GB)". This information, including a progress bar, can also be found clicking on Photos > Preferences > iCloud. Also there is a very handy button to "Pause for one day" the uploading and downloading of items. When paused, the button changes to "Resume" and the progress bar displays instead the number of items in iCloud, uploaded by other devices, that have not been downloaded to your Mac.

But there are some things that I have noticed about all this. For example, the number of uploading items and their total size—the 7,162 and 33.92 GB respectively from my example—seem to include all items still considered for upload and their size, even if they were previously uploaded to iCloud by one of your other devices. So the number of items actually uploaded might be less than that. The other number, the one showing the size already uploaded—the 2.07 GB from my example—seems to become increasingly inaccurate. My guess is that when Photos is uploading a file and for some reason it gets interrupted, the uploading of that file might start again from zero, but the progress doesn't go back, and the file size ends up being accounted more than once. So I've learned not to trust that number. It is only good to see that things are moving on.

But, while this whole uploading process is happening, I was wondering how to know which items from the Photos Library on my Mac have been uploaded, and even better what exactly is being uploaded, in case things seem to be stuck? I have found two ways to find what is being uploaded. One of them is less precise and just give you an idea of which items are being uploaded, the other shows you exactly which files are being uploaded. In my own anecdotal experience, the photos and videos seem to be uploaded in chronological order, from newest to oldest, which helps particularly with the first method below.

The not-so-precise method requires that you have assigned names to the faces found in the Faces album. One of the nice things about using iCloud Photo Library is that those faces now become searchable in Photos on your iOS device, but of course, only for the items that have been already uploaded from your Mac to iCloud and downloaded to your device. So for example, my son is in a high percentage of my photos. If I search for his name in Photos on my iPhone, the oldest photo found—conveniently shown at the top of the list—gives me a good indication of the latest items being uploaded. The search results also show the geographical location of the photos, their date, and a "Show All" button that when tapped shows the other photos in the same group. As I said, not very precise but lets you know where the progress is.

The other method requires starting Activity Monitor on your Mac. On the Network page, if the processes are sorted by Sent Bytes in descending order, towards the top of the list—if not at the very top—there should be a process called "cloudd". Select it and click on the Info button (or command-I). Select "Open Files and Ports" and from the list displayed you should find one or more entries that start like this "/Users//Pictures/Photos Library.photoslibrary/private/com.apple.cloudphotosd/CloudSync.noindex/Engine/filecache/..." These are the files being uploaded. To see them, in Finder, control-click on you Photos Library > Show Package Contents and follow the path above from "private/". This should lead you exactly to the file being uploaded.

In my case, it means that I still have about 10 years worth of photos to upload.

Starting with Xcode 6.3 and WatchKit

With the official release of Xcode 6.3 (8 April 2015), including WatchKit and Swift 1.2, I've decided to make ThisMany available also for Apple Watch. An app like ThisMany should be ideal for the watch.

The first step was to upgrade my version of Xcode from 6.1.1 to 6.3—easily done—and then compile the app to make sure that everything was still agreeing with the new version of Swift. Unfortunately, the code didn't compile. But fortunately Xcode can be very helpful giving you "Fix-it" hints on how to solve your compilation issues. I found that all my compilation errors, except one, were due to the new as! operator that was introduced in Swift 1.2. Before 1.2 the as operator was used for both upcasting and downcasting. But in Swift 1.2 these conversions are separated in two operators. The as operator is still used for upcasting, or guaranteed conversion, but the as! operator is now used for downcasting, or forced conversion.  Apple has an informative post about these changes in their very useful Swift Blog: The as! Operator.

The other compilation error that I found was in the auto-generated code when you create an app with Core Data enabled. To fix that I simply created a new app with Core Data enabled, compared the auto-generated code from Xcode 6.1.1 with the one from Xcode 6.3, and upgraded my old code accordingly. Easy fix.

With everything compiling and running as expected, the next step was to configure my Xcode project for WatchKit. To do this, again, I referred to Apple's documentation about developing for Apple Watch: Configuring Your Xcode Project. Basically, all you have to do is to add a WatchKit app target to your existing iOS app project. Xcode adds to your project a WatchKit Extension, which runs on the iPhone, and a WatchKit app, which runs on the Apple Watch. Easy. Lets compile again. Error.

This time I got an error in Xcode with this:

error: WatchKit apps must have a deployment target equal to iOS 8.2 (was 8.3)

It seems—I thought—that WatchKit wants the deployment target of my project to be 8.2 and not 8.3. So, I changed it in the project Info page, but still it didn't compile, and I got again the same error. What am I missing? This time, I went to the Build Settings of all my targets, not just the project, and changed the iOS Deployment Target for all of them to iOS 8.2. Success. Now everything compiles.

Well, this is just the beginning. I am just starting with this. Next, I need to go through more Apple documentation and see how to layout a proper Apple Watch UI, and connect everything to my app.

Fun times ahead.