Mac Format

Add cloud sync to any app

Transfer settings and more across Macs using Dropbox and symlinks

-

SKILL LEVEL

Taking things further

IT WILL TAKE

15 minutes

YOU’ll NEED A Dropbox account, a web connection, an app with stored settings to sync

Key moments in technology – once experience­d – ruin the alternativ­es, including much of what’s gone before. For example, experience the delight of high-res displays and you might wince if you find yourself able to make out the individual pixels in an old screen you’ve been plonked in front of; similarly, embrace the power of the cloud and data rooted to a single location will feel as archaic as typing ‘LOAD "*",8,1’ to run a video game.

If you’ve used any reasonably recent Apple kit along with iCloud, you’ll know how valuable and convenient cloudbased data syncing can be. Instead of manually copying contacts and calendar appointmen­ts to individual devices, everything’s up to date within seconds of you opening the relevant app. This line of thinking extends through email when using IMAP, open browser tabs in Safari, online passwords if you’ve set up iCloud Keychain, and app-specific documents when using products that can save to the cloud.

The main problem with iCloud is that it’s not (yet) universal. Many apps and games lack any kind of cloud sync at all. There are, however, ways around this, involving tinkering in the OS X Library folder, a cloud-based sync service such as Dropbox (this is what we’ll use for this tutorial), and symbolic links (known as symlinks).

Symlinks are conceptual­ly similar to aliases, which you might have used before to create a shortcut in Finder to a folder or file that’s located elsewhere on your Mac. However, whereas an alias points to a file or folder regardless of its location on your Mac, symlinks are instead effectivel­y a text file that denotes a specific, unchanging path.

Move whatever it’s pointing at and the symlink won’t resolve, which seems like a disadvanta­ge; however, symlinks tend to be transparen­t to applicatio­ns and sync services (whereas aliases aren’t always), meaning you can use them to essentiall­y ‘trick’ an app into saving its files and preference­s into a non-default

Many apps and games lack any kind of cloud sync at all. There are, however, ways around this…

location on your Mac without any problems occurring.

This means we can set up a scenario in which the location of certain systemorie­nted files is shifted to Dropbox, even though the apps think they’re saved in the normal location. With identical symlinks subsequent­ly created on multiple Macs, all with your Dropbox folder synced, you can use the same set of app data with multiple machines, effectivel­y providing cloud-based sync for apps that don’t offer this natively.

Master this technique and you can use it for all sorts of things: game progress; settings for a favourite art package; the database for an invoicing app you access from multiple Macs.

There are, however, some things to bear in mind. Importantl­y, don’t simultaneo­usly work with synced data on multiple machines, and ensure when data is changed that it’s fully updated on Dropbox before you launch the app it belongs to. It’s also not always apparent where apps save data. Some will save to a specific or user-defined folder in ~/Documents. In ~/Library, you might find databases and other documents in Applicatio­n Support, and settings in Preference­s. For Mac App Store apps, items are (mostly) stored in ~/Library/Containers.

Mac App Store apps complicate things further by not enabling you to make symlinks of individual files within the folders found in ~/Library/ Containers. During testing, however, we found you can move the app’s entire directory within Containers to Dropbox and symlink that. Also, OS X Mavericks now caches preference­s files for dear life, and so if you use this tutorial’s technique to keep app set-ups identical across multiple Macs, you’ll need to flush the cache before launching your app after any preference­s have changed. This can be done in Terminal using

killall cfprefsd. Craig Grannell

 ??  ?? Symbolic links can fool OS X into thinking they’re the genuine files – even if they point to a cloud service.
Symbolic links can fool OS X into thinking they’re the genuine files – even if they point to a cloud service.
 ??  ?? As excellent as it is, iCloud doesn’t yet have the features of Dropbox we’re exploiting here.
As excellent as it is, iCloud doesn’t yet have the features of Dropbox we’re exploiting here.
 ??  ??

Newspapers in English

Newspapers from Australia