xc-mcp
Version:
MCP server that wraps Xcode command-line tools for iOS/macOS development workflows
54 lines • 4.72 kB
TypeScript
/**
* Access iOS app file system containers for inspection
*
* **What it does:**
* Retrieves the file system path to an app's container directories on a simulator,
* enabling direct access to app bundle, data directories, and shared group containers
* for debugging and testing.
*
* **Why you'd use it:**
* - Debug data access enables inspection of app Documents and Library folders
* - File inspection allows viewing database files, preferences, and cached data
* - Testing validation confirms app writes data to correct locations
* - Container types support bundle (app binary), data (Documents/Library), and group (shared) access
*
* **Parameters:**
* - `udid` (string): Simulator UDID (from simctl-list)
* - `bundleId` (string): App bundle ID (e.g., com.example.MyApp)
* - `containerType` (string, optional): Container type - bundle, data, or group (default: data)
*
* **Returns:**
* Container path with type information and guidance for accessing files
*
* **Example:**
* ```typescript
* // Get app data container path
* await simctlGetAppContainerTool({
* udid: 'ABC-123-DEF',
* bundleId: 'com.example.MyApp'
* })
*
* // Get app bundle path
* await simctlGetAppContainerTool({
* udid: 'ABC-123-DEF',
* bundleId: 'com.example.MyApp',
* containerType: 'bundle'
* })
* ```
*
* **Full documentation:** See simctl/get-app-container.md for container types and debugging
*
* @param args Container query configuration (requires udid and bundleId)
* @returns Tool result with container path and file access guidance
* @throws McpError for app not installed or container access failure
*/
export declare function simctlGetAppContainerTool(args: any): Promise<{
content: {
type: "text";
text: string;
}[];
isError: boolean;
}>;
export declare const SIMCTL_GET_APP_CONTAINER_DOCS = "\n# simctl-get-app-container\n\nAccess iOS app file system containers for inspection and debugging.\n\n## What it does\n\nRetrieves the file system path to an app's container directories on a simulator,\nenabling direct access to app bundle, data directories, and shared group containers\nfor debugging and testing.\n\n## Why you'd use it\n\n- **Debug data access**: Inspect app Documents and Library folders\n- **File inspection**: View database files, preferences, and cached data\n- **Testing validation**: Confirm app writes data to correct locations\n- **Container types**: Access bundle (app binary), data (Documents/Library), and group (shared) containers\n\n## Parameters\n\n- **udid** (string, required): Simulator UDID (from simctl-list)\n- **bundleId** (string, required): App bundle ID (e.g., com.example.MyApp)\n- **containerType** (string, optional): Container type - bundle, data, or group (default: data)\n\n## Container Types\n\n- **bundle**: App binary and resources (read-only)\n- **data**: App's Documents and Library directories (read-write)\n- **group**: Shared containers for app groups (read-write)\n\n## Returns\n\nJSON response with:\n- Container path for file system access\n- Container type information\n- Guidance for accessing and inspecting files\n- Simulator state and validation\n\n## Examples\n\n### Get app data container path\n```typescript\nawait simctlGetAppContainerTool({\n udid: 'ABC-123-DEF',\n bundleId: 'com.example.MyApp'\n})\n```\n\n### Get app bundle path\n```typescript\nawait simctlGetAppContainerTool({\n udid: 'ABC-123-DEF',\n bundleId: 'com.example.MyApp',\n containerType: 'bundle'\n})\n```\n\n## Common Use Cases\n\n1. **Debugging data persistence**: Access app's Documents folder to inspect saved files\n2. **Database inspection**: View SQLite database files and validate schema\n3. **Preferences debugging**: Check UserDefaults plist files\n4. **Cache validation**: Verify cached data is stored correctly\n5. **Bundle inspection**: Access app binary and embedded resources\n\n## Error Handling\n\n- **App not installed**: Returns error if app is not installed on simulator\n- **Invalid bundle ID**: Validates bundle ID format (must contain '.')\n- **Simulator not found**: Validates simulator exists in cache\n- **Container access failure**: Reports if container cannot be accessed\n\n## Next Steps After Getting Container Path\n\n1. **View files**: `cd \"<container-path>\" && ls -la`\n2. **Open in Finder**: `open \"<container-path>/Documents\"`\n3. **Find files**: `find \"<container-path>\" -type f | head -20`\n4. **Inspect specific file**: `cat \"<container-path>/Documents/data.json\"`\n";
export declare const SIMCTL_GET_APP_CONTAINER_DOCS_MINI = "Get app container path on simulator. Use rtfm({ toolName: \"simctl-get-app-container\" }) for docs.";
//# sourceMappingURL=get-app-container.d.ts.map