UNPKG

xc-mcp

Version:

MCP server that wraps Xcode command-line tools for iOS/macOS development workflows

26 lines 4.21 kB
/** * Open a URL in a simulator (deep linking support) * * Examples: * - Open web URL: udid: "device-123", url: "https://example.com" * - Open deep link: udid: "device-123", url: "myapp://open?id=123" * - Open mailto: udid: "device-123", url: "mailto:test@example.com" * - Open tel: udid: "device-123", url: "tel:+1234567890" * * Supports: * - HTTP/HTTPS URLs * - Custom scheme deep links (myapp://) * - Special URLs (mailto:, tel:, sms:, etc.) * * **Full documentation:** See simctl/openurl.md for detailed parameters and examples */ export declare function simctlOpenUrlTool(args: any): Promise<{ content: { type: "text"; text: string; }[]; isError: boolean; }>; export declare const SIMCTL_OPENURL_DOCS = "\n# simctl-openurl\n\nOpen URLs in a simulator, including web URLs, deep links, and special URL schemes.\n\n## What it does\n\nOpens a URL in the simulator, which can be a web URL (http/https), custom app deep link\n(myapp://), or special URL scheme (mailto:, tel:, sms:). The system will route the URL\nto the appropriate app handler.\n\n## Parameters\n\n- **udid** (string, required): Simulator UDID (from simctl-list)\n- **url** (string, required): URL to open (e.g., https://example.com or myapp://deeplink?id=123)\n\n## Supported URL Schemes\n\n- **HTTP/HTTPS**: Web URLs (opens in Safari)\n- **Custom schemes**: Deep links to your app (myapp://, yourapp://)\n- **mailto**: Email composition (opens Mail app)\n- **tel**: Phone dialer (opens Phone app on iPhone)\n- **sms**: SMS composition (opens Messages app)\n- **facetime**: FaceTime calls\n- **maps**: Apple Maps URLs\n\n## Returns\n\nJSON response with:\n- URL open status\n- Detected URL scheme\n- Guidance for testing URL handling and deep links\n\n## Examples\n\n### Open web URL\n```typescript\nawait simctlOpenUrlTool({\n udid: 'device-123',\n url: 'https://example.com'\n})\n```\n\n### Open deep link with parameters\n```typescript\nawait simctlOpenUrlTool({\n udid: 'device-123',\n url: 'myapp://open?id=123&action=view'\n})\n```\n\n### Open mailto link\n```typescript\nawait simctlOpenUrlTool({\n udid: 'device-123',\n url: 'mailto:test@example.com?subject=Hello'\n})\n```\n\n### Open tel link\n```typescript\nawait simctlOpenUrlTool({\n udid: 'device-123',\n url: 'tel:+1234567890'\n})\n```\n\n## Common Use Cases\n\n1. **Deep link testing**: Verify app handles custom URL schemes correctly\n2. **Universal links**: Test https:// URLs that open your app\n3. **Navigation testing**: Confirm deep links navigate to correct screens\n4. **Parameter parsing**: Verify URL parameters are parsed correctly\n5. **Fallback handling**: Test behavior when no handler is registered\n\n## Important Notes\n\n- **Simulator must be booted**: URLs can only be opened on running simulators\n- **Handler registration**: Custom schemes require an app that handles them\n- **URL encoding**: Ensure URL parameters are properly encoded\n- **Timing**: Consider launching app first if testing immediate URL handling\n\n## Error Handling\n\n- **No handler registered**: Error if no app handles the URL scheme\n- **Simulator not booted**: Indicates simulator must be booted first\n- **Invalid URL format**: Validates URL has proper scheme and format\n- **Simulator not found**: Validates simulator exists in cache\n\n## Deep Link Testing Workflow\n\n1. **Install app**: `simctl-install <udid> /path/to/App.app`\n2. **Launch app**: `simctl-launch <udid> <bundleId>`\n3. **Open deep link**: `simctl-openurl <udid> myapp://route?param=value`\n4. **Take screenshot**: `simctl-io <udid> screenshot` to verify navigation\n5. **Check logs**: Monitor console for URL handling logs\n\n## Testing Strategies\n\n- **Parameter variations**: Test different query parameters\n- **Invalid URLs**: Verify error handling for malformed URLs\n- **Background handling**: Test URLs when app is backgrounded\n- **Fresh launch**: Test URLs when app is not running\n- **State preservation**: Verify app state is maintained after URL handling\n"; export declare const SIMCTL_OPENURL_DOCS_MINI = "Open URLs and deep links on simulator. Use rtfm({ toolName: \"simctl-openurl\" }) for docs."; //# sourceMappingURL=openurl.d.ts.map