This is the location on the file system that macOS uses to store user-specific data for sandboxed apps.
To locate and delete the data files associated with an iOS app installed on macOS (e.g., via the App Store), follow the steps below:
Determine the installed app's bundle identifier:
Open Terminal.app and run the following command-line to retrieve the bundle identifier of the installed iOS app:
defaults read /Applications/<app_name>.app/Wrapper/iTunesMetadata.plist softwareVersionBundleId
Replace <app_name> with the name of the app as it appears in the /Applications directory. You can find it by navigating to /Applications directory in Finder or Terminal.
For e.g., install X (formerly Twitter) app from the App Store using this link: https://apps.apple.com/app/x/id333903271
The app will appear as X.app in /Applications directory.
Now running the command-line:
defaults read /Applications/X.app/Wrapper/iTunesMetadata.plist softwareVersionBundleId
will output the bundle identifier as:
com.atebits.Tweetie2
Uninstall the app:
Delete the app either through Launchpad or by removing the app bundle from the /Applications directory. You can also remove the app using the command-line:
rm -rf /Applications/X.app
Navigate to the Containers Directory ~/Library/Containers/:
Navigate to the directory by running the command-line:
cd ~/Library/Containers/
Search for the app's Container using its bundle identifier:
Search for the app’s bundle identifier to find its container directory by running the command-line:
find . -iname "<bundle_identifier>"
For example, in this case, run the command-line:
find . -iname "com.atebits.Tweetie2"
The find command will print the path for matching Container. In this case, the output will be shown as below (the Container ID may differ):
./ABE705EF-93F7-43C4-9966-443465F6942D/Data/Library/Application Scripts/com.atebits.Tweetie2
./ABE705EF-93F7-43C4-9966-443465F6942D/Data/Library/HTTPStorages/com.atebits.Tweetie2
./ABE705EF-93F7-43C4-9966-443465F6942D/Data/Library/Caches/com.crashlytics.data/com.atebits.Tweetie2
./ABE705EF-93F7-43C4-9966-443465F6942D/Data/Library/Caches/com.atebits.Tweetie2
Delete the app's Container:
Delete the top-level Container directory (the one starting with the UUID), by running the command-line:
rm -rf <container_id>
For e.g. in the above case, run the command-line:
rm -rm ./ABE705EF-93F7-43C4-9966-443465F6942D
(Optional) Delete Group Containers:
Some apps may create a Group Container. To check for the presence of a Group Container, navigate to the directory: ~/Library/Group Containers/:
cd ~/Library/Group Containers/
perform a search using the same find command:
find . -iname "<bundle_identifier>"
then delete the corresponding group container folder (if any found):
rm -rf <container_id>
(Optional) Delete Preferences and Caches:
Navigate to the following directories one-by-one:
cd ~/Library/Preferences/
and
cd ~/Library/Caches/
search for the bundle identifier using the same find command and get rid of any matching files.
(Optionally) Restart your Mac:
Restarting the Mac ensures all the related caches are fully flushed.
Check for TestFlight App Data:
For apps installed via TestFlight, its data may reside under: ~/Library/Developer directory.
Search and delete any containers or folders related to the bundle identifier here if the above steps didn’t remove all data.