Swift-native Media Transfer Protocol stack with device quirks, modern SwiftUI implementation, and comprehensive verification suite.
A privacy-safe, evidence-gated MTP implementation for macOS and iOS with adaptive device handling and comprehensive device quirk support.
- Current release train:
2.0.0(2026-02-08) - Active work: 2.1.x planning with stability and documentation improvements
- Change tracking:
CHANGELOG.md - Docs index:
Docs/README.md - Delivery plan:
Docs/ROADMAP.md - Sprint execution playbook:
Docs/SPRINT-PLAYBOOK.md - Release prep:
Docs/ROADMAP.release-checklist.md - Testing gates:
Docs/ROADMAP.testing.md - Contribution workflow:
Docs/ContributionGuide.md - Operator troubleshooting:
Docs/Troubleshooting.md
Use this order when joining an active sprint:
- Read scope and acceptance criteria in
Docs/ROADMAP.md. - Confirm operating rules in
Docs/SPRINT-PLAYBOOK.md. - Run the
Sprint Readiness Loopbelow. - For transport/quirk changes, capture evidence with
device-bringup. - Update docs +
CHANGELOG.mdin the same PR.
Weekly sprint rhythm:
- Monday: confirm scope, risks, and ready-state of sprint items.
- Midweek: run checkpoint gates and resolve drift (test/docs/CI).
- Friday: close or carry over items using DoD from the sprint playbook.
Use this command loop for implementation sprints:
# 1) Build + targeted checks while iterating
swift build --package-path SwiftMTPKit
swift test --package-path SwiftMTPKit --filter CoreTests
# 2) No-hardware smoke contract checks
./scripts/smoke.sh
# 3) Milestone/full gate before merge
./run-all-tests.shFor real-device mode evidence capture:
./scripts/device-bringup.sh --mode mtp-unlocked --vid 0x18d1 --pid 0x4ee1SwiftMTP is built with modern Swift 6 concurrency patterns:
SwiftMTPCore: Actor-isolated MTP protocol implementation with async/awaitSwiftMTPTransportLibUSB: USB transport layer using libusb with fallback supportSwiftMTPIndex: SQLite-based device content indexing and snapshotsSwiftMTPSync: Mirror, sync, and diff operations with conflict resolutionSwiftMTPUI: Modern SwiftUI library using@Observablefor reactive data flowSwiftMTPQuirks: Device-specific tuning database with learned profilesSwiftMTPObservability: Structured logging and performance monitoringSwiftMTPStore: Persistence layer for device metadata and transfer journalsswiftmtp-cli: High-performance CLI tool for automation and power usersSwiftMTPApp: Standalone macOS GUI application for device management
- Privacy-First Design: Read-only collection mode with strict defaults
- Device Quirks System: Learned profiles and static quirks for 50+ devices
- Transfer Journaling: Resumable operations with automatic recovery
- File Provider Integration: Native Finder integration on macOS (XPC service)
- Benchmarking Suite: Performance profiling with p50/p95 metrics
- Demo Mode: Simulated hardware profiles for development without physical devices
-
macOS Tahoe 26.0+ (macOS 2026, requires Apple Silicon or Intel Mac with Tahoe upgrade)
-
iOS 26.0+ (partial support: index, sync, and FileProvider operations; USB transport requires macOS host)
-
macOS 26.0+ / iOS 26.0+
-
Xcode 16.0+ with Swift 6 (
6.2recommended) -
libusbinstalled via Homebrew:brew install libusb
swift run --package-path SwiftMTPKit SwiftMTPAppswift run swiftmtp --helpbrew tap effortlessmetrics/swiftmtp
brew install swiftmtpSwiftMTP utilizes a multi-layered verification strategy:
./run-all-tests.shBy default this runs:
- SwiftMTPKit matrix (BDD + property + fuzz + integration + unit + e2e + snapshot + storybook)
- Xcode app + unit + UI automation tests (set
RUN_XCODE_UI_TESTS=0to skip UI tests)
swift test --package-path SwiftMTPKit --filter BDDTestsswift test --package-path SwiftMTPKit --filter PropertyTestsswift test --package-path SwiftMTPKit --filter SnapshotTests./SwiftMTPKit/run-fuzz.sh./SwiftMTPKit/run-storybook.sh| Device | VID:PID | Status | Notes |
|---|---|---|---|
| Google Pixel 7 | 18d1:4ee1 | Uses quirk-gated reset+reopen ladder on OpenSession I/O failures | |
| OnePlus 3T | 2a70:f003 | Probe/read stable; write-path tuning is still in-progress | |
| Xiaomi Mi Note 2 | 2717:ff10 / 2717:ff40 | โ Stable | ff40 variant uses vendor-specific MTP interface matching |
| Samsung Galaxy S21 | 04e8:6860 | Requires storage unlock prompt; class 0xff interface | |
| Canon EOS (Rebel / R-class) | 04a9:3139 | ๐งช Experimental | PTP over USB; camera must be in PTP/MTP mode |
| Nikon DSLR / Z-series | 04b0:0410 | ๐งช Experimental | MTP/PTP mode required; NEF files need extended IO timeout |
See Docs/SwiftMTP.docc/Devices/ for device-specific tuning guides.
swift run swiftmtp device-lab connected --jsonArtifacts are written under Docs/benchmarks/connected-lab/<timestamp>/ with per-device JSON reports.
./scripts/device-bringup.sh --mode mtp-unlocked --vid 0x18d1 --pid 0x4ee1This captures system_profiler USB data, swiftmtp usb-dump, and device-lab outputs under Docs/benchmarks/device-bringup/<timestamp>-<mode>/.
See Docs/device-bringup.md for the (device ร mode ร operation) matrix.
Develop without physical hardware using simulated profiles:
# Enable demo mode
export SWIFTMTP_DEMO_MODE=1
# Select mock profile
export SWIFTMTP_MOCK_PROFILE=pixel7 # Options: pixel7, galaxy, iphone, canon
# Run CLI in demo mode
swift run swiftmtp probeGUI users can toggle simulation via the Orange Play button in the toolbar.
Benchmark results from real devices:
| Device | Read Speed | Write Speed | Status |
|---|---|---|---|
| Google Pixel 7 | N/A | N/A | Blocked on Tahoe 26 bulk-transfer timeout |
| OnePlus 3T | N/A | N/A | Probe/read stable, large write path in progress |
| Samsung Galaxy S21 | 15.8 MB/s | 12.4 MB/s | Experimental but measurable |
See Docs/benchmarks.md for detailed performance analysis.
- Contribution guide
- Roadmap and milestones
- Sprint playbook
- Testing guide
- Device submission workflow
- Release runbook
git clone https://github.com/effortlessmetrics/swiftmtp.git
cd swiftmtp
swift build./scripts/build-libusb-xcframework.shswift package --disable-sandbox preview-documentation --target SwiftMTPCoreswift-format -i -r Sources Tests
swift-format lint -r Sources TestsSwiftMTP/
โโโ SwiftMTPKit/ # Swift Package root
โ โโโ Sources/
โ โ โโโ SwiftMTPCore/ # Core MTP protocol
โ โ โโโ SwiftMTPTransportLibUSB/
โ โ โโโ SwiftMTPIndex/ # SQLite indexing
โ โ โโโ SwiftMTPSync/ # Mirror/sync
โ โ โโโ SwiftMTPUI/ # SwiftUI views
โ โ โโโ SwiftMTPQuirks/ # Device quirks
โ โ โโโ SwiftMTPObservability/ # Logging
โ โ โโโ SwiftMTPStore/ # Persistence
โ โ โโโ Tools/ # CLI & App targets
โ โโโ Tests/ # BDD, Property, Snapshot
โโโ Docs/ # Documentation
โ โโโ SwiftMTP.docc/ # DocC documentation
โ โโโ benchmarks/ # Performance data
โโโ Specs/ # Schemas & quirks
โโโ legal/ # Licensing
โโโ scripts/ # Build & release tools
SwiftMTP is dual-licensed:
- AGPL-3.0 for open-source use
- Commercial license for closed-source/App Store distribution
See legal/outbound/COMMERCIAL-LICENSE.md or contact git@effortlesssteven.com.
- CucumberSwift for BDD testing
- SwiftCheck for property-based testing
- swift-snapshot-testing for visual regression
- libusb for cross-platform USB access