Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

211 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SwiftMTP

SwiftMTP Logo

Native macOS Android MTP File Transfer Tool

Swift Version Platform License


๐ŸŒ Languages: English | ็ฎ€ไฝ“ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž | ํ•œ๊ตญ์–ด | ะ ัƒััะบะธะน | Franรงais | Deutsch


โœจ Features

Feature Description
๐Ÿ”Œ Auto Device Detection Automatically detect connected Android devices
๐Ÿ“ File Browsing Smoothly browse device file system
โฌ‡๏ธ File Download Support single and batch file downloads
โฌ†๏ธ File Upload Support button selection and drag-and-drop file uploads
๐Ÿ’พ Large File Support Support >4GB file transfers
๐Ÿ“ฆ Batch Operations Batch select and process files
๐ŸŽจ Modern UI Beautiful SwiftUI interface
๐Ÿ“Š Storage Info Display device storage usage
๐ŸŒ Multi-language Support Support English, Simplified Chinese, Japanese, Korean, Russian, French, German, follows system language

๐Ÿ“ธ App Screenshots

Main Interface File Transfer
Main Interface File Transfer

๐Ÿš€ Quick Start

Requirements

Dependency Version
macOS 26.0+ (or higher)
Xcode 26.0+
Homebrew Latest version

Install Dependencies

brew install go

๐Ÿ“ Note: libusb-1.0 is now bundled with the application, so no manual installation is required.

Build and Run

# Clone the repository
git clone https://github.com/wang93wei/SwiftMTP.git
cd SwiftMTP

# Build Go bridge layer
./Scripts/build_kalam.sh

# Open in Xcode and run
open SwiftMTP.xcodeproj

๐Ÿ“ Note: Project configuration files have been committed to version control. After cloning, simply open the project in Xcode and start building without any additional configuration.

๐Ÿ’ก Tip: After connecting your Android device, select File Transfer (MTP) mode on the device to start using.

Create Installation Package

# Simplified packaging (no developer certificate required)
./Scripts/create_dmg_simple.sh

# Full packaging (requires developer certificate)
./Scripts/create_dmg.sh

The DMG file will be generated in the build/ directory.

๐Ÿ“– User Guide

Connecting a Device

  1. Connect your Android device to Mac via USB
  2. Select File Transfer (MTP) mode on the device
  3. SwiftMTP will automatically detect and display the device

File Operations

Operation Method
Browse files Double-click folders to enter, use breadcrumb navigation to go back
Download file Right-click file โ†’ Download
Batch download Multi-select files โ†’ Right-click โ†’ Download Selected Files
Upload file Click Upload File button in toolbar or drag-drop files to window
Drag-and-drop upload Drag files to file browser window to upload

Language Settings

  1. Open Settings window (โŒ˜ + ,)
  2. Select language in General tab
  3. Available languages:
    • System Default - Follow macOS system language
    • English - English interface
    • Simplified Chinese - Simplified Chinese interface
    • Japanese - Japanese interface
    • Korean - Korean interface
    • Russian - Russian interface
    • French - French interface
    • German - German interface
  4. In-app interface will update language immediately
  5. Menu bar and file pickers require app restart to take effect, system will prompt for immediate restart

๐Ÿ—๏ธ Project Architecture

SwiftMTP/
โ”œโ”€โ”€ Native/                         # Go bridge layer (Kalam Kernel)
โ”‚   โ”œโ”€โ”€ kalam_*.go                 # Split bridge modules (CGO)
โ”‚   โ”œโ”€โ”€ *_test.go                  # Go unit tests by module
โ”‚   โ”œโ”€โ”€ libkalam.h                 # C header (Swift bridging)
โ”‚   โ”œโ”€โ”€ go.mod / go.sum            # Go module dependencies
โ”‚   โ””โ”€โ”€ vendor/                    # Go dependencies (go-mtpx, usb)
โ”œโ”€โ”€ Scripts/
โ”‚   โ”œโ”€โ”€ build_kalam.sh             # Build Go dynamic library
โ”‚   โ”œโ”€โ”€ create_dmg.sh              # DMG packaging script
โ”‚   โ”œโ”€โ”€ create_dmg_simple.sh       # Simplified packaging
โ”‚   โ”œโ”€โ”€ generate_icons.sh          # Icon generation script
โ”‚   โ”œโ”€โ”€ run_tests.sh               # Test running script
โ”‚   โ””โ”€โ”€ SwiftMTP/                  # Resource scripts
โ”‚       โ””โ”€โ”€ App/Assets.xcassets/   # App icon resources
โ”œโ”€โ”€ SwiftMTP/                      # Swift application
โ”‚   โ”œโ”€โ”€ App/                       # App entry
โ”‚   โ”‚   โ”œโ”€โ”€ SwiftMTPApp.swift      # App entry point
โ”‚   โ”‚   โ”œโ”€โ”€ Info.plist             # App configuration
โ”‚   โ”‚   โ”œโ”€โ”€ Assets.xcassets/       # Asset bundle (icons)
โ”‚   โ”‚   โ””โ”€โ”€ Resources/             # App resources
โ”‚   โ”‚       โ””โ”€โ”€ SwiftMTP_Logo.svg  # App Logo
โ”‚   โ”œโ”€โ”€ Models/                    # Data models
โ”‚   โ”‚   โ”œโ”€โ”€ Device.swift           # Device model
โ”‚   โ”‚   โ”œโ”€โ”€ FileItem.swift         # File model
โ”‚   โ”‚   โ”œโ”€โ”€ TransferTask.swift     # Transfer task model
โ”‚   โ”‚   โ”œโ”€โ”€ AppLanguage.swift      # Language model
โ”‚   โ”‚   โ”œโ”€โ”€ AppError.swift         # Error type definitions
โ”‚   โ”‚   โ””โ”€โ”€ UpdateInfo.swift       # Update information model
โ”‚   โ”œโ”€โ”€ Services/                  # Service layer
โ”‚   โ”‚   โ”œโ”€โ”€ MTP/                   # MTP services
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DeviceManager.swift    # Device management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FileSystemManager.swift# File system
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FileTransferManager.swift # Transfer management
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ FileTransferManager+DirectoryUpload.swift # Directory upload extension
โ”‚   โ”‚   โ”œโ”€โ”€ Protocols/             # Protocol definitions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DeviceManaging.swift
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FileSystemManaging.swift
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FileTransferManaging.swift
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ LanguageManaging.swift
โ”‚   โ”‚   โ”œโ”€โ”€ LanguageManager.swift  # Language manager
โ”‚   โ”‚   โ”œโ”€โ”€ LocalizationManager.swift # Localization manager
โ”‚   โ”‚   โ””โ”€โ”€ UpdateChecker.swift    # Update checker
โ”‚   โ”œโ”€โ”€ Config/                    # Configuration
โ”‚   โ”‚   โ””โ”€โ”€ AppConfiguration.swift # App configuration constants
โ”‚   โ”œโ”€โ”€ Views/                     # SwiftUI views
โ”‚   โ”‚   โ”œโ”€โ”€ MainWindowView.swift   # Main window
โ”‚   โ”‚   โ”œโ”€โ”€ DeviceListView.swift   # Device list
โ”‚   โ”‚   โ”œโ”€โ”€ FileBrowserView.swift  # File browser
โ”‚   โ”‚   โ”œโ”€โ”€ FileBrowserView+Actions.swift # File browser actions
โ”‚   โ”‚   โ”œโ”€โ”€ FileBrowserView+ToolbarDrop.swift # File browser toolbar & drag-drop
โ”‚   โ”‚   โ”œโ”€โ”€ TableDoubleClickModifier.swift # Table double-click bridge
โ”‚   โ”‚   โ”œโ”€โ”€ FileTransferView.swift # Transfer view
โ”‚   โ”‚   โ”œโ”€โ”€ SettingsView.swift     # Settings window
โ”‚   โ”‚   โ””โ”€โ”€ Components/            # Reusable components
โ”‚   โ”‚       โ”œโ”€โ”€ DeviceRowView.swift
โ”‚   โ”‚       โ”œโ”€โ”€ LiquidGlassView.swift
โ”‚   โ”‚       โ””โ”€โ”€ TransferTaskRowView.swift
โ”‚   โ”œโ”€โ”€ Resources/                 # Resource files
โ”‚   โ”‚   โ”œโ”€โ”€ libkalam.dylib         # Go dynamic library (CGO bridge)
โ”‚   โ”‚   โ”œโ”€โ”€ Base.lproj/            # Base language pack (English)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ en.lproj/              # English language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ zh-Hans.lproj/         # Simplified Chinese language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ ja.lproj/              # Japanese language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ ko.lproj/              # Korean language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ ru.lproj/              # Russian language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ”œโ”€โ”€ fr.lproj/              # French language pack
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Localizable.strings
โ”‚   โ”‚   โ””โ”€โ”€ de.lproj/              # German language pack
โ”‚   โ”‚       โ”œโ”€โ”€ InfoPlist.strings
โ”‚   โ”‚       โ””โ”€โ”€ Localizable.strings
โ”‚   โ”œโ”€โ”€ libkalam.dylib             # Go dynamic library
โ”‚   โ”œโ”€โ”€ libkalam.h                 # C header file
โ”‚   โ””โ”€โ”€ SwiftMTP-Bridging-Header.h # Swift-C bridging header
โ”œโ”€โ”€ docs/                          # Project documentation
โ”‚   โ”œโ”€โ”€ sequence-diagrams.md       # Sequence diagram documentation
โ”‚   โ”œโ”€โ”€ TESTING.md                 # Testing documentation
โ”‚   โ””โ”€โ”€ WIKI.md                    # Project Wiki
โ”œโ”€โ”€ build/                         # Build output directory
โ”œโ”€โ”€ .github/workflows/             # GitHub Actions
โ”‚   โ””โ”€โ”€ test.yml                   # CI test configuration
โ””โ”€โ”€ SwiftMTP.xcodeproj/            # Xcode project

Tech Stack

  • Languages: Swift 6+, Go 1.23+
  • UI Framework: SwiftUI
  • MTP Library: go-mtpx (based on libusb-1.0)
  • Architecture Pattern: MVVM
  • Bridging Method: CGO
  • Internationalization: Swift localization framework (NSLocalizedString)

โš ๏ธ Known Limitations

  1. Sandbox must be disabled to access USB devices
  2. Transfer speed is limited by MTP protocol
  3. Liquid Glass UI implementation is incomplete and contains bugs that need fixing
  4. We welcome more contributors to help improve the codebase

๐Ÿ”ง Troubleshooting

Device Not Detected

โœ“ Ensure device is in MTP mode
โœ“ Try unplugging and reconnecting USB cable
โœ“ Restart the app
โœ“ Check if USB cable supports data transfer

Build Errors

# Rebuild Go bridge layer
./Scripts/build_kalam.sh

# Clean and rebuild
xcodebuild clean
xcodebuild

๐Ÿ™ Acknowledgments

This project is based on OpenMTP backend. Special thanks to the OpenMTP team for their excellent work on the MTP implementation for macOS.

๐Ÿค Contributing

Issues and Pull Requests are welcome!

๐Ÿ“„ License

This project is licensed under MIT License - see the LICENSE file for details.


If this project helps you, please โญ Star to support!

Star History Chart

About

Swift x Android MTP tool

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages