iCloud Drive Symbolic Links broke Mac sidebar shortcuts

So I wanted to make programming life easier by keeping content within my iCloud drive to not worry about my content being backed up. I didn't want to type the entire iCloud directory path before each of my scripts could be executed:


"/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/"


So I went to my home folder in terminal and wrote up a couple of symbolic links


ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/" iCloud

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development" Dev

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/CloudFormation" CF

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/Python" Py

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/myChef" Chef


But now, the iCloud shortcut icons on the left side of finder no longer work. More importantly, when i browse the iCloud drive, the Development folder has disappeared completely, and I can only get to it by its symbolic link. Same thing with the subfolders for CF, Py and Chef.


Does anyone know how to restore the original symbolic links for iCloud on my mac?


I have multiple Macs and would have to put those symbolic links on to each one of them to get proper access again.

MacBook Pro with Retina display, macOS Sierra (10.12.4)

Posted on May 4, 2017 10:41 AM

Reply
1 reply

Aug 20, 2017 4:13 AM in response to DavidDominik

The arguments in your ln command have a few mistakes in them so it created an invalid link. If you are escaping space with a \ then don't use quotes. If you are using quotes then don't use \ to escape anything however you should not put \ in front of ~ in either case because it doesn't need escaped. Also its best to put the full path to the destination of the symlink as well as the source.


Here is an example of how to symlink a "Projects" folder to iCloud Drive:


Create Projects folder on iCloud Drive. Replace your username:



ln -s /Users/mh/Library/Mobile\ Documents/com~apple~CloudDocs/Projects

/Users/mh/Projects



chflags -h hidden /Users/mh/Projects


The second command hides it from the home folder the same way the Desktop and Documents get hidden.


The very weird thing is that Apple actually do this the other way around. The data is in the Documents folder as normal (except it is hidden) and they put a symlink in iCloud Drive. We however can't put symlink in iCloud Drive so they must have some special handling in Finder to allow it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

iCloud Drive Symbolic Links broke Mac sidebar shortcuts

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.