7

Is it possible to use iCloud drive like Dropbox? What I want to do is create a symbolic link to Desktop, Documents and perhaps my Downloads folder in iCloud Drive, similar to how I'd do it in Dropbox. I don't want to use the 'Desktop and Documents' setting in iCloud. It does some weird stuff with my Desktop and Documents folder locally.

3
  • 1
    What prevents you from doing so, what did you try and where did it turn out not to work as expected?
    – nohillside
    Commented Jul 27, 2018 at 15:16
  • What weird stuff does it do if you use that setting?
    – Natsfan
    Commented Jul 27, 2018 at 15:26
  • 1
    I'm hesitant to try it, because Apple has a setting for Desktop and Documents syncing. I don't know how its implemented currently, but when done previously, it moved the whole Desktop and Documents folder to ~/Library/Mobile\ Documents and then created a symlink back to the home directory. If you turn it off for whatever reason, then your Desktop and Documents folder used to disappear from home folder and reside in the Library folder. My hesitancy is honestly because I don't think Apple is super reliable with this server side stuff unlike Dropbox(in how its implemented I mean).
    – Venkat
    Commented Jul 27, 2018 at 16:03

6 Answers 6

10

Just enter the below line into your terminal and you can navigate to your iCloud via the terminal.

ln -s "/Users/$USER/Library/Mobile Documents/com~apple~CloudDocs" iCloud
3

Apple has a built-in setting to do basically exactly what you want. It's not technically a symlink, but it accomplishes the same functionality. It also gracefully handles different desktops on different machines. And it all works as expected in the Files app on iOS:

https://support.apple.com/en-us/HT206985

1
  • Yah, but I really want to sync a folder to both icloud and google drive and that doesn't help (sync not just backup). Commented Jan 15, 2021 at 2:15
2

I faced the same issue with symlinks. It seems, unfortunately, iCloud doesn't support symlinks (except these desktop and documents folders).

But it's possible with Dropbox:

https://apple.stackexchange.com/a/319593/308689

UPD. Whoops, they dropped support of symlinks. Nobody supports symlinks :(

1

Yes, it's entirely possible.

You can create a directory in ~/Library/Mobile\ Documents and then symlink that wherever you like.

1
  • 2
    Maybe you misunderstand, but I want to create a symlink top desktop folder and documents folder and place that symlink in iCloud Drive. I have tried this, however the Files app on iOS doesn't recognize the folder, and doesn't show the contents(it thinks its an alias file that's all)
    – Venkat
    Commented Sep 6, 2018 at 21:28
1

I ended up making hard links of individual files to iCloud Drive folder.
You can make a script that would links all files from specific folder to iCloud, but it might not be practical for whole Documents.

ln myfile.txt ~/Library/Mobile\ Documents/com~apple~CloudDocs/important_folder/myfile.txt
1

Based on the man ln documentation, you need ln -sn or ln -sh:

ln -sn ~/Library/Mobile\ Documents/com\~apple\~CloudDocs MyiCloudFolder

from man:

-h If the target_file or target_dir is a symbolic link, do not follow it. This is most useful with the -f option, to replace a symlink which may point to a directory.

-n Same as -h, for compatibility with other ln implementations.

-s Create a symbolic link.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jan 26 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .