UNPKG

xc-mcp

Version:

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

21 lines 3.79 kB
/** * Add media files (photos, videos) to a simulator's photo library * * Examples: * - Add image: udid: "device-123", mediaPath: "/path/to/photo.jpg" * - Add video: udid: "device-123", mediaPath: "/path/to/video.mp4" * * Supported image formats: jpg, jpeg, png, heic, gif, bmp * Supported video formats: mp4, mov, avi, mkv * * **Full documentation:** See simctl/addmedia.md for detailed parameters and examples */ export declare function simctlAddmediaTool(args: any): Promise<{ content: { type: "text"; text: string; }[]; isError: boolean; }>; export declare const SIMCTL_ADDMEDIA_DOCS = "\n# simctl-addmedia\n\nAdd media files (photos and videos) to a simulator's photo library for testing.\n\n## What it does\n\nAdds image or video files to the simulator's Photos app, making them available for\napps to access via PHPhotoLibrary or UIImagePickerController APIs.\n\n## Parameters\n\n- **udid** (string, required): Simulator UDID (from simctl-list)\n- **mediaPath** (string, required): Path to image or video file\n\n## Supported Formats\n\n**Images**: jpg, jpeg, png, heic, gif, bmp\n**Videos**: mp4, mov, avi, mkv\n\n## Returns\n\nJSON response with:\n- Media addition status\n- Media type and format detected\n- Guidance for viewing in Photos app and adding more media\n\n## Examples\n\n### Add image to photo library\n```typescript\nawait simctlAddmediaTool({\n udid: 'device-123',\n mediaPath: '/path/to/photo.jpg'\n})\n```\n\n### Add video to photo library\n```typescript\nawait simctlAddmediaTool({\n udid: 'device-123',\n mediaPath: '/path/to/video.mp4'\n})\n```\n\n## Common Use Cases\n\n1. **Photo picker testing**: Add test images for UIImagePickerController testing\n2. **PHPhotoLibrary testing**: Populate library for photo access API testing\n3. **Image processing**: Add images to test filters, crops, and transformations\n4. **Video playback**: Add videos to test AVPlayer integration\n5. **Camera roll simulation**: Populate library to simulate real user photo collection\n\n## Important Notes\n\n- **File must exist**: Validates file exists before attempting to add\n- **Format validation**: Only supported image/video formats are accepted\n- **Simulator state**: Works on both booted and shutdown simulators\n- **Photos app**: Media appears in simulator's Photos app immediately\n- **Metadata**: Original file metadata (EXIF, date, etc.) is preserved\n\n## Error Handling\n\n- **File not found**: Error if media file path doesn't exist\n- **Unsupported format**: Error if file extension is not in supported list\n- **Simulator not found**: Validates simulator exists in cache\n- **Addition failure**: Reports simctl errors if media cannot be added\n\n## Next Steps After Adding Media\n\n1. **View in Photos app**: `simctl-launch <udid> com.apple.mobileslideshow`\n2. **Test photo picker**: Launch your app and open UIImagePickerController\n3. **Add more media**: Repeat with different images/videos\n4. **Test PHPhotoLibrary**: Use PHPhotoLibrary.requestAuthorization() in your app\n\n## Testing Workflow\n\n1. **Grant photo permissions**: `simctl-privacy <udid> <bundleId> grant photos`\n2. **Add test media**: `simctl-addmedia <udid> /path/to/photo.jpg`\n3. **Launch app**: `simctl-launch <udid> <bundleId>`\n4. **Test photo access**: Verify app can read from photo library\n5. **Take screenshot**: `simctl-io <udid> screenshot` to verify UI\n\n## Tips\n\n- **Test image formats**: Add different image formats (JPEG, PNG, HEIC) to test compatibility\n- **Test video formats**: Add various video formats (MP4, MOV) to test playback\n- **Large files**: Be aware that adding large video files may take time\n- **Batch addition**: Add multiple files to simulate realistic photo library\n"; //# sourceMappingURL=addmedia.d.ts.map