3

For whatever reason, Apple has decided to make "iCloud Drive" actually available at an impossible-to-remember and painful-to-type location.

Is there any better method than a symlink to make it available at (for example) /Volumes/iCloud?

Is there any particular problem putting a symlink in /Volumes? Is it even possible? Will I somehow bork my system if I try it with sudo?

Update

I'm not asking how to create a symlink. That can be boiled down to

sudo ln -s "$HOME/Library/Mobile Documents/com~apple~CloudDocs" /Volumes/iCloud

but it leaves all of the app-specific folders out, because $HOME/Library/Mobile Documents/com~apple~CloudDocs only includes folders and files that you created in the root of the iCloud Drive. All the nifty folders with app icons on them are not there, but instead have equally obscure names up a level in $HOME/Library/Mobile Documents.

4
  • 1
    You can try to put it in /Volumes but I don't believe it's possible. I would just symlink ~/iCloud. This seems to be exactly what symlinks are for, is there anything you have against them?
    – Ezekiel
    Commented Oct 9, 2021 at 15:55
  • The hesitation I had was about symlinking to /Volumes. I clearly wouldn't copy any real files there. Also ~/iCloud is not a standard location. remote and local volumes normally go in /Volumes, so there's nothing special to remember.
    – iconoclast
    Commented Oct 9, 2021 at 20:07
  • The question got rather broad with the edit, it now seems to ask whether symlinking into /Volumes is feasible, how to get iCloud folders with icons and maybe something else as well. Can you please edit the question to increase the focus?
    – nohillside
    Commented Oct 7, 2022 at 6:38
  • @nohillside: the question remains narrow: how can we solve the problem created by Apple's horrible and impossible-to-remember paths? Nothing changed.
    – iconoclast
    Commented Oct 7, 2022 at 22:38

2 Answers 2

2

Symlinks is the way to go, but it took me several tries to work out the kinks, probably due to the spaces Apple insists on putting everywhere in the directory names and how complicated the cloud drive path is.

Open Finder on iCloud Drive and pick a file.

Right click, press ⌥ (option) key and choose Copy <filename> as Pathname.

Now you have the full file path in your clipboard.

In my case, I took a file called diagram.svg in the root of my documents.

Open a Terminal (I did this with Kitty + zsh, but don't see why iTerm2 or Terminal would not work with bash or zsh).

cd home and Paste your file name. Don't hit Enter
% cd ~                                                                
% ~/Users/me/Library/Mobile Documents/com~apple~CloudDocs/diagram.svg

Now, adjust your command line.

  • remove the file name, up to Cloudocs/
  • 1️⃣ put quotes around the filename
  • 2️⃣ give your desired home/ name. I used icloud, could be anything, preferably without spaces.
  • 3️⃣ ln -s in the front to create a symlink.
  • 4️⃣ put in your actual username (as it shows in when you type pwd in ~). But you would already have it if you copied the path from Finder.

#     4️⃣      👇 replace `me` with your username, e.g. `jsmith`

ln -s "/Users/me/Library/Mobile Documents/com~apple~CloudDocs" icloud


#     1️⃣☝️quote it to avoid problems from spaces in the path ☝️1️⃣
#        provide your desired home directory symlink name       ☝️2️⃣                 
#☝️3️⃣ ln -s creates a symlink

Press enter. Now you have a symlink on terminal that you can navigate to with cd ~/icloud.

% cd ~/icloud 
icloud % ls -l diag*
-rw-r--r--@ 1 me  staff  20794 10 Sep  2020 diagram.svg

Way too complicated. Terminal use could be easier with macOS special directories. Lots of things could be easier on the terminal with macOS, looking at you mdfind / Spotlight.

4
  • 2
    Not sure what you mean with complicated. All one needs is the one line with the ln -s command, this can be easily copied from your answer.
    – nohillside
    Commented Oct 6, 2022 at 20:41
  • 1
    I shouldn't have had to putz around with Finder Copy Path because the directory was so difficult to correctly refer to on the cli. I got several "file doesn't exist" errors from my initial linking attempts even though it seemed to be the right path. Discovering the full path should not be this difficult. After searching for an answer here, this is the closest I found to a matching question, so I posted this answer. Which may hopefully make things less complicated for others. Just my opinion anyway. And macOS terminal experience still beats Windows'.
    – JL Peyret
    Commented Oct 6, 2022 at 21:43
  • symlinks are a good way to "shortcut" to more complicated locations, though not their only use. /Volumes/ is a place where I expect to mount "drives", but in this case iCloud is already "mounted" elsewhere. I don't know if it is me being insufficient comfortable with Unix systems, but I always feel kinda bad doing anything in that directory, besides mounting things in it. However, it is quite possible/probable a symlink in /Volumes/ poses no risks - I am unqualified to have a solid opinion one way or the other. That's probably something you could research independent of iCloud.
    – JL Peyret
    Commented Oct 6, 2022 at 23:31
  • Agreed, it takes some time to get used to the way shells handle whitespace characters. About symlinking from Volumes: it should work. The only caveat I see is that a symlink in Volumes only works for one user (account), so if several people are using the same Mac with individual accounts a solution within ones home directory might be better.
    – nohillside
    Commented Oct 7, 2022 at 5:33
2

Direct Answer
Yes, you can symlink from /Volumes without issues. I don't know of a technical reason not to. Terminal starts in the home folder by default, so that's probably why it was recommended by others. I agree that the Volumes directory makes sense for iCloud Drive. Symlinking from either or both is fine.

Cloud Paths
The first "iCloud Drive" can access most things (without little pictures). The second is the "Mobile Documents" folder (with little pictures) and contains the extra things visible from Finder looking at iCloud Drive.

Paths:

  1. iCloud Drive: $HOME/Library/Mobile Documents/com~apple~CloudDocs

  2. Mobile Documents: $HOME/Library/Mobile Documents

Note: Use $HOME instead of ~ so you don't receive an error when listing. I'm mentioning it here because the lack of function can be misleading.

user@hostname ~ % ls "~/Library/Mobile Documents"
ls: ~/Library/Mobile Documents: No such file or directory

Symbolic Link (symlink)
Link to these paths from anywhere you like.

Symlink from Volumes

sudo ln -s "$HOME/Library/Mobile Documents/com~apple~CloudDocs" "/Volumes/iCloudDrive"
sudo ln -s "$HOME/Library/Mobile Documents" "/Volumes/mobileDocuments"

Symlink from Home

ln -s "$HOME/Library/Mobile Documents/com~apple~CloudDocs" iCloudDrive
ln -s "$HOME/Library/Mobile Documents" mobileDocuments

What is Intended from Apple?
Use what's available. For example, TextEdit.app (Text Editor) has an iCloud saving feature that shows up from iCloud Drive as TextEdit with a little picture in the folder. You can open files from here. You can also save files to here (by default) as 1 of 2 options listed under "Cloud Library". The second is iCloud Drive, which includes the same folder and all your other iCloud folders (without the little pictures). In other words, open/save things the easy way.
reference1: https://discussions.apple.com/thread/4980973
reference2: https://discussions.apple.com/thread/250439086

Alternate Paths:
From Finder, browse to iCloud Drive and then right-click on a special folder (with the little pictures). Then choose "New Terminal at Folder" or "New Terminal Tab at Folder". This opens terminal in the directory's alternate path. Use pwd to see where it is. Here are a few of them:

TextEdit
$HOME/Library/Mobile Documents/com~apple~TextEdit/Documents

Shortcuts
$HOME/Library/Mobile Documents/iCloud~is~workflow~my~workflows/Documents

Playgrounds
$HOME/Library/Mobile Documents/iCloud~com~apple~Playgrounds/Documents

Controller for HomeKit
$HOME/Library/Mobile Documents/iCloud~com~janandre~HomeKitTimers/Documents

GarageBand for iOS
$HOME/Library/Mobile Documents/F3LWYJ7GM7~com~apple~mobilegarageband/Documents

Keynote
$HOME/Library/Mobile Documents/com~apple~Keynote/Documents

Numbers
$HOME/Library/Mobile Documents/com~apple~Numbers/Documents
2
  • I'm not sure what are you trying to say in your answer but I found at least 2 mistakes. 1. the TextEdit folder is not under the com~apple~CloudDocs, it in the Mobile Documents folder.
    – Ryan
    Commented Mar 27, 2023 at 8:03
  • 2. trying to list the directory will give an error because the tilde ~ character inside the double quote will not expand to /Users/<username>. You have to use $HOME/Library instead of ~/Library
    – Ryan
    Commented Mar 27, 2023 at 8:10

You must log in to answer this question.

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