Access iCloud Drive via the Command Line

I wanted to write a short script for accessing iCloud Drive via the command line, and to my surprise this seems to be an ultra-special place that does not show up in /Volumes or even in my home directory the way Dropbox does.


Any vets here know the path, if not to enlightenment, then to iCloud Drive?


Thanks in advance.

Posted on Dec 22, 2015 7:42 AM

Reply
3 replies

Dec 22, 2015 8:02 AM in response to Andrew LaGow

This is actually a pretty interesting problem. I did the research I should have done prior to coming here and found that iCloud Drive is accessible here:


~/Library/Mobile\ Documents


What's interesting is that among the many, many interesting things found in this directory when you reveal all the files via ls -al, is that custom directories don't seem to show up. Even more interesting, in Finder, select Go > Go to Folder... and type in that path and it doesn't recognize the path. Type ~/Library/ and of course that is fine and you see the Mobile Documents directory...

Dec 22, 2015 8:18 AM in response to Andrew LaGow

This just gets more interesting the deeper I go. If ls ~/Library/Mobile\ Documents in Terminal reveals everything about how custom data across your mobile apps is stored and passed around from device to device except any custom folders you've made, try the same path in an app like PathFinder. I use it regularly, and revealed is a more sanitized version of the same thing, with the exception that many preference files used for your iOS device are not displayed.


All pretty fascinating, but I'm no closer to accessing my custom directory directly in iCloud Drive. I'll have to settle, I think, for a simple alias in .bashrc like


alias mydirectory="cd ~/Library/Mobile\ Documents; open ."


Unless someone's got a better idea.

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.

Access iCloud Drive via the Command Line

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