Free up space on your Mac by clearing Containers in macOS

2 min read

The addition of Sandboxing in macOS added predefined app folders to the operating system. It’s essential to know how to remove unnecessary folders in order to reclaim drive space. More than a decade ago, Apple introduced Sandboxing as a security measure that restricts an app’s access to the macOS file system. When developers build apps with Apple’s Xcode for macOS, they can set sandbox permissions for each app by modifying settings in Xcode. Depending on the permission levels set in an Xcode project’s Target build settings, an app built with Xcode can access the entire file system, only certain defined files and folders, the network, or nothing. An Xcode target represents one piece of software to be built and can be added to an Xcode project by selecting New then Target from Xcode’s File menu.
The operating system uses entitlements in a file with an extension of “.entitlements” to store sandbox settings. Bundles are used to store code, resources, or files to be used at runtime. You can still build macOS apps without sandboxing by turning off the sandboxing switch in an Xcode project’s settings under the Build Settings tab or by editing the Entitlements file directly.
The Info.plist file contains additional app sandboxing info and is generated when you build an app in Xcode. When a sandboxed app is run on macOS, an app-specific folder is created inside the ~/Library/Containers folder for that app. Over time, these container folders can grow in size. It’s safe to delete the app folder in the Containers folder for apps you no longer use, except for Apple Software apps that you won’t use.
You can view the size of all app container folders in the Containers directory by clicking the Size header column label. Be aware that once you delete an app’s container folder, any data stored for that app may be gone from your Mac, so it may be wise to back up any app container folders that you intend to delete first. The entire ~/Library/Containers folder can grow to several gigabytes in size, so periodically deleting app container folders can free up a bit of disk space. It’s recommended to check the Containers folder periodically and remove any app container folders you don’t need.

You May Also Like

More From Author