# SwiftMTP
**Repository Path**: wang93wei/SwiftMTP
## Basic Information
- **Project Name**: SwiftMTP
- **Description**: Swift x Android MTP tool
- **Primary Language**: Swift
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-01-21
- **Last Updated**: 2026-03-09
## Categories & Tags
**Categories**: Uncategorized
**Tags**: MTP, Android, Swift
## README
# SwiftMTP

**Native macOS Android MTP File Transfer Tool**
[](https://swift.org)
[](https://www.apple.com/macos/)
[](LICENSE)
---
**๐ Languages:** [English](README.md) | [็ฎไฝไธญๆ](docs/README.zh-CN.md) | [ๆฅๆฌ่ช](docs/README.ja.md) | [ํ๊ตญ์ด](docs/README.ko.md) | [ะ ัััะบะธะน](docs/README.ru.md) | [Franรงais](docs/README.fr.md) | [Deutsch](docs/README.de.md)
---
## โจ 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 |
|:---:|:---:|
|  |  |
## ๐ Quick Start
### Requirements
| Dependency | Version |
|------------|---------|
| macOS | 26.0+ (or higher) |
| Xcode | 26.0+ |
| Homebrew | Latest version |
### Install Dependencies
```bash
brew install go
```
> ๐ **Note**: libusb-1.0 is now bundled with the application, so no manual installation is required.
### Build and Run
```bash
# 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
```bash
# 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
```bash
# Rebuild Go bridge layer
./Scripts/build_kalam.sh
# Clean and rebuild
xcodebuild clean
xcodebuild
```
## ๐ค Contributing
Issues and Pull Requests are welcome!
## ๐ License
This project is licensed under MIT License - see the [LICENSE](LICENSE) file for details.
---
**If this project helps you, please โญ Star to support!**
[](https://star-history.com/#wang93wei/SwiftMTP&Date)