There are some folders in ~/Library/Mobile Documents/ (like XXXXXX~com~companyname~appname) which seems to be left by apps I already removed from all my devices. However, if I delete those folders, they restored back almost immediately. They are not visible in Finder or in iCloud management in System Preferences. How to get rid of them?
- 341
4 Answers
Those should be the same apps listed under System Settings/iCloud/Manage... (button down right next to the bar), so you can delete them there.
- 192
-
Well, it works, but not on 100%. Some apps are shown in iCloud Manage on macOS or iOS, but not all. – iMisanthrope Mar 15 '18 at 07:50
-
1
Apps that utilise iCloud storage create containers where application data is stored. When an App is uninstalled, an uninstall routine is called which allows the App to clear up local and remote files, however not every developer implements this.
The following method has worked for all but one of my App containers. I have raised the issue with Apple.
Fix iCloud persistence
- Re-install the App or Apps in question
- Open Settings App
- Tap your name at the top to open iCloud Settings
- Tap "iCloud"
- Under "Apps Using iCloud" click "Show All"
- Switch "Off" the App or Apps in question
- Click the back arrow to return to "iCloud"
- Click "Manage Account Storage"
- Find the App or Apps in the list, select and click "Delete Documents and Data..."
Clean up leftover artifacts
- Clear CloudDocs of folders referring to deleted Apps
- Open your Terminal of choice and enter the following command:
cd ~/"Library/Application Support/CloudDocs/session/containers" - List all files and folders in the directory by using the command
ls -a - Delete any and all files or folders referring to Apps that have since been deleted on your iOS or MacOS devices (ensure the App has been deleted). Use the following command to delete from the command line:
rm -rf iCloud.com.publisher.appname
- Delete iCloud App Library
- In a Terminal, enter the following command:
cd ~/"Library/Mobile Documents/com~apple~CloudDocs" - Enter the command
cd ../to go up one level - List all files and folders in the directory by using the command
ls -a
- You will now see the 'Documents' data for each App that has data stored in iCloud, simply deleting artifacts from this director is not enough! The
birddaemon will re-download from iCloud.
- Open one of the target artifacts using the following command:
open iCloud~com~reddit~reddit
- Right click on the folder name in Finder breadcrumbs and click "Copy as Pathname"
- Go back to Terminal and enter the following command:
rm -R PATHNAME(enter the pathname you copied where specified) - Enter the following command:
cd ~/"Library/Mobile Documents/com~apple~CloudDocs" - Enter the command
cd ../to go up one level - List all files and folders in the directory by using the command
ls -a - Now remove the artifact using the
rm -R ARTIFACTNAMEcommand
Ideally, Apps should 'clean up' after themselves during deletion which would avoid this process.
If the App does not appear in "Manage Account Storage" despite being re-installed, cd into the iCloud~com~publisher~appname directory, and cd into the Documents folder within that directory. From there, create some dummy files, such as touch index.html. Reload "Manage Account Storage" and the App will appear, ready for deletion.
- 21
- 3
-
"Removing the artifact" does not remove the artifact. Just tried this and
birdjust replaces it. – John Aug 06 '23 at 22:56 -
Admittedly this has worked for 5 out of 6 of my artifacts. Try a few more times, ensuring you're deleting the 'content' from iCloud in Settings. I raised this with Apple a while ago, yet to receive a response. – felpsey Aug 07 '23 at 09:49
You cannot do that, this is how iCloud works.
These folders are how iCloud is designed to work, so you can stop using iCloud or forget about your intentions for a 'clean system'; sorry for saying this but you are not using a Linux flavor.
So, iCloud is not designed to allow you to micromanage it. The folders will be empty if you have no data in that application. [Upadate] This method isn’t working
- 270
Have you tried a 3rd party app like 'App Cleaner'? it removes files that are left behind when you just delete an app. It may work in your case.
- 14,185



~/Library/Mobile Documents/com~apple~CloudDocs/and some folders from apps I using, like Automator, Pixelmator, Pages, etc... But there is a bunch of folders created by apps I already removed, and those folders are invisible everywhere except of Terminalls -acommand. – iMisanthrope Mar 02 '17 at 13:27cd ~/Library/Mobile\ Documents; du -sk * | sort -rnyou will see most of those directories are largely empty. You can always create a new Apple ID and start from scratch :-) – MichaelR Oct 18 '17 at 00:46openfolder command in terminal. – Roberto Jul 27 '20 at 07:16rm -rfand they just come right back). They don't show up in Settings > iCloud > Manage Storage or on web. The dystopia has arrived—we are no longer in control of our own machines. – luckman212 Sep 30 '23 at 19:22