Inspect App Sandbox Container
simctl-containerInspect an iOS simulator app's sandbox by bundle ID: list files, read plist or text contents, view UserDefaults, and locate Core Data stores.
Instructions
simctl-container
App sandbox inspector — list files, read file contents, inspect UserDefaults, and locate Core Data stores inside an iOS simulator app's data container.
What it does
Resolves the app data container via xcrun simctl get_app_container, then performs semantic
file operations within that sandbox without needing to know the raw CoreSimulator path.
Parameters
bundleId (string, required): App bundle identifier (e.g. com.example.MyApp)
mode (string, required): Operation —
ls|cat|userdefaults|coredata-pathudid (string, optional): Simulator UDID. Defaults to booted device.
path (string, optional): Sub-path for
ls(subdir) or file path forcatdepth (number, optional): Recursion depth for
ls(default: 3)
Modes
ls
Lists files in the container (or a sub-path) up to depth levels deep.
Returns entries with path, kind (file/dir/symlink), and sizeBytes.
Path traversal outside the container root is rejected.
cat
Reads a file at path (relative to container root).
Attempts plist decode first (binary and XML plists via
plutil)Falls back to UTF-8 text, then binary detection
Returns
contentType:plist|text|binaryFiles > 8 KB (text/plist) are stored in responseCache; returns
cacheId+resourceLink
userdefaults
Reads Library/Preferences/<bundleId>.plist and returns decoded key/value pairs.
Handles both binary and XML plist formats via plutil.
coredata-path
Searches Library/Application Support/ and Documents/ recursively for
.sqlite, .sqlite-wal, and .sqlite-shm files.
Returns { path, absolutePath, sizeBytes, type } for each store found.
Returns
JSON response with { mode, bundleId, success, ... } plus mode-specific fields and guidance.
Examples
List container root
await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'ls' })List a sub-directory
await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'ls', path: 'Library/Caches' })Read a JSON config file
await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'cat', path: 'Documents/config.json' })Inspect UserDefaults
await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'userdefaults' })Find Core Data stores
await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'coredata-path' })Error Handling
bundleId required: Rejects empty or missing bundleId
mode required: Rejects unknown or missing mode
path required for cat: Rejects cat without a path
container not found: InternalError with install suggestion
path escapes container: InvalidRequest with clear message
plist unreadable: InternalError with path context
Notes
Keychain is explicitly out of scope
Binary plist decoding uses
plutil -convert json(macOS built-in)Large text/plist files (> 8 KB) are cached; retrieve via
cacheIdusing the cache tool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| path | No | ||
| udid | No | ||
| depth | No | ||
| bundleId | Yes |