XcodeBuildMCP icon indicating copy to clipboard operation
XcodeBuildMCP copied to clipboard

[Feature] Add archive and export functionality

Open krishsatya opened this issue 6 months ago • 1 comments

Archive and Export Support

Summary

Add support for archiving Xcode projects and exporting archives for distribution. This would complete the build pipeline by enabling the final steps needed for App Store submission and distribution.

Motivation

Currently, the MCP provides comprehensive build and test capabilities but lacks archive/export functionality. Users need to fall back to raw xcodebuild commands via bash for these operations, breaking the unified MCP workflow.

Proposed Implementation

New Tools to Add:

  1. archive_ws - Archive from workspace files
  2. archive_proj - Archive from project files
  3. export_archive - Export archives with various distribution methods

Parameters Needed:

  • archivePath - Output location for .xcarchive
  • exportPath - Output location for exported app
  • exportMethod - App Store, Developer ID, Ad Hoc, etc.
  • exportOptionsPlist - Custom export options
  • Code signing configuration options

Example Usage:

// Archive the project
archive_proj({ 
  projectPath: "/path/to/MyApp.xcodeproj", 
  scheme: "MyApp",
  archivePath: "/path/to/MyApp.xcarchive"
})

// Export for App Store
export_archive({
  archivePath: "/path/to/MyApp.xcarchive",
  exportPath: "/path/to/exports",
  exportMethod: "app-store"
})

Implementation Notes

  • Could follow existing patterns from build_mac_proj.ts and similar commands
  • Leverage existing executeXcodeBuild helper function
  • Need to handle export options plist generation/validation
  • Consider progress reporting for large archive operations

xcodebuild Commands to Wrap:

xcodebuild archive -project MyApp.xcodeproj -scheme MyApp -archivePath MyApp.xcarchive
xcodebuild -exportArchive -archivePath MyApp.xcarchive -exportPath ./exports -exportOptionsPlist ExportOptions.plist

This would make the MCP a complete solution for the entire iOS/macOS build and distribution pipeline.

krishsatya avatar Jun 29 '25 17:06 krishsatya

Do you want to try and have a stab at this and put an PR together?

cameroncooke avatar Jun 30 '25 08:06 cameroncooke