android-file-transfer-linux

whoozleLGPL-2.1活跃维护

在 Linux 和 macOS 上通过 MTP 协议与 Android 手机互传文件,支持 FUSE 挂载和命令行操作,替代官方仅限 Mac 的传输工具。

Android File Transfer for Linux (and macOS!)

v4.6发布于 2026-10-11 22:06 UTC1,707star +1 / 7 天132fork同步于 2026-11-10 17:49 UTC

怎么上手

由 README 提炼,执行前请确认
sudo apt-get install android-file-transfer
硬件要求按 README 说明

README 未说明具体硬件要求;需要能通过 USB 连接支持 MTP 的 Android 设备,FUSE 挂载需系统安装 libfuse。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Linux/macOS 上的 MTP 客户端,替代 gmtp 等工具解决崩溃、文件损坏和 USB 卡死问题

在 Linux 和 macOS 上通过 MTP 协议与 Android 手机互传文件,支持 FUSE 挂载和命令行操作,替代官方仅限 Mac 的传输工具。

核心能力

  • 提供简洁 Qt 图形界面,带传输进度对话框
  • 内置 FUSE 封装,可把设备挂载为目录并支持部分读写
  • 不依赖 libmtp/libptp,自带 MTP 协议实现
  • 附带 aft-mtp-cli 命令行工具和 Python 绑定
  • 利用新内核 USB zerocopy 减少用户态与内核态拷贝

容易踩的坑

FUSE 挂载传输比 UI/CLI 慢 7-8 倍;三星设备因移除 MTP 扩展,FUSE 只能只读挂载;从源码构建需单独安装 Qt、libfuse 和 readline 开发包,只编译库可关闭 BUILD_QT_UI。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.6
  1. v4.6v4.6 is out最新正式版2026-10-11 · 2026-10-11 22:06 UTC

    This is small maintenance release Changes:

    • Fix double-counting files and folders
    • Fix reading/writing files user doesn't have read/write permissions.
    • Disable device friendly name/battery level in cli if they can't be read but advertised.
    • Fix MacOS linking
    • InquirerPy instead of PyInquirer, whatever it is :joy:
    • Add pyproject.toml
  2. v4.54.5 is out! (some amazing news for Zune owners included)2025-05-14 · 2025-05-14 22:20 UTC
    查看更新说明

    Thanks to the community nudges I looked into a few issues found since the latest release (and also some amazing news in the end)

    Here's what was done since v4.4:

    • API fix - GetObjectPropDesc missed object format
    • Fuse ported to version 3.x - with a nasty surprise from MacOSX
    • Linux builder was upgraded to Ubuntu 22.4
    • TagLib 2.x support - album picture is now extracted from metadata and uploaded when you import your library (if your device supports album artwork). I guess it's mostly for the Zune users but who knows which devices may support this.
    • Some Microsoft specific codes added (probably totally useless)
    • Implemented "DeviceReboot" mtp extension
    • SendObjectInfo can use separate bulk transfers for header/body (Zune)
    • And now the most exciting bit - you can now flash Zune without using original software (which is hard to find/obsoleted/requires /etc/hosts hacking etc etc). I tried Zune 4/Zune HD 16 and they both flashed and recovered perfectly fine
    • Nintendo Switch can be connected a few times instead of just once (fixed invalid CloseSession param, and now it gracefully closes session).

    Thanks everyone involved, have fun!

  3. v4.42025-03-31 · 2025-03-31 11:40 UTC
    查看更新说明

    Qt6 and newer Android devices support

    A few notable improvements in this release:

    • Qt6 support [ui]
    • Do not call ClearHalt - shouldn't be any halts, maybe re-enable it later if anything breaks - fixes freezing newer android devices.
    • Claim interface with disconnect and do it only for MTP devices.
    • When scanning for processes holding descriptor, generate less noise and exceptions [cli]
    • get-id command [cli]
    • set both st_size and st_blocks [fuse]
    • return ENOTEMPTY for non-empty dirs. [fuse]
    • CI improvements and cleanups, MacOSX fixes, GH actions and cmake cleanups
  4. v4.3Hello Haiku and Good Riddance Snapcraft2023-12-12 · 2023-12-12 20:39 UTC
    查看更新说明

    Oh dear. This is second revision of my rant about Canonical Snapcraft and other changes we all made in the course of the latest 3 years. Previous version was nuked by inaccurate GH actions script, sorry about that.

    Also I'd like to say sorry that it took so long. I was thinking "not enough changes to make a new release" after EACH commit I pushed. Now the time has come.

    Good news and bad news:

    Good news: Welcome new OS! AFTL is now supporting Haiku OS. (Also many fixes, please find the changes below)

    Bad news: Canonical went full corporate mode and rejected AFTL personal files permission with some proper manure:

    Use of the personal-files interface is reserved for vetted publishers.

    VETTED PUBLISHERS EH :clown_face: All right, no AFTL on snapcraft then, good riddance!

    Now the changelog:

    • Python bindings are now live - please use it in your automation
    • EditObject warning is more concise - it basically says that you can't write to the individual files - sorry. UI uses different method anyway, use it as the last resort.
    • Updated CS, IT, NL, RU translations
    • Big writes for fuse
    • Do not return zero in st_links field of stat, return 1
    • Fix DST handling in date/time conversion
    • Moved to GH Actions from Travis, good riddance N2
    • Haiku OS support (along with libedit/readline)
    • aft-mtp-mount is actually resetting device when -D specified
    • More documentation for more distros
    • Add VENDOR:PRODUCT usb id filtering
    • Provide st_uid/st_gid values for stat structure - no more roots (bloody roots)
    • Add CI for tagged releases!

    Thanks!

  5. v4.2Nintendo Switch Support / Samsung Emergency Fix2020-12-29 · 2020-12-29 21:27 UTC
    查看更新说明

    Samsung users should upgrade to v4.2, this release fixes freezes after an upload attempt. This is very serious regression since 3.9, so it deserves the new release.

    Nintendo Switch is very important addition in this release too. Its features are pretty much limited, because Nintendo implemented the absolute minimum command set. Also it is lacking any write functionality, but still surprisingly functional (it even has thumbnails!). Fuse FS implementation now can operate without partial read extension, using in-memory object cache.

    Another important features are is multiple device support. aft-mtp-cli now has -d <filter> option allowing you to filter matching devices. The same applies to aft-mtp-mount (-D <filter>). UI will show simple dialog with list. Kill functionality moved into that dialog too.

    More missing MacOSX bits implemented (EP stall flag clear). Travis CI build log: https://travis-ci.org/whoozle/android-file-transfer-linux/builds/752033786/

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Android File Transfer For Linux (FreeBSD and macOS, too!)

    License Version Android File Transfer for Linux (and macOS!)

    Android File Transfer for Linux — a reliable MTP client with minimalistic UI similar to Android File Transfer.

    AFTL Screenshot

    It just works™.

    Do I need it?

    If you're happy with gmtp/gvfs/mtpfs or any other MTP software, you might not need this software (but give it a try!).

    If you're suffering from crashes, missing tags, album covers, USB freezes, and corrupted files however, this software is right for you.

    Pre-built Packages

    If your distribution does not provide an android-file-transfer-linux package, you can still install it on your system.

    There's quite a few packages available:

    Support me

    If you want to help me with development, click on the link below and follow the instructions. I'm working on this project in my spare time and I try to fix everything as fast as possible, sometimes adding features in realtime (more than 100 tickets closed by now). Any amount would help relieving the pain of using MTP. :D

    https://www.paypal.me/whoozle

    Features

    • Simple Qt UI with progress dialogs.
    • FUSE wrapper (if you prefer mounting your device), supporting partial read/writes, allowing instant access to your files.
    • No file size limits.
    • Automatically renames album cover to make it visible from media player.
    • Supports Zune and Zune HD.
    • USB zerocopy support found in recent Linux kernels (no user/kernel data copying).
    • No extra dependencies (e.g. libptp or libmtp).
    • Available as a static/shared library.
    • Command line tool aft-mtp-cli.
    • Python bindings.

    FAQ

    Please take a look at the FAQ if you have issues with your operating system. It's not that big, but those are the questions asked very often.

    Installation

    Debian/Ubuntu

    sudo apt-get install android-file-transfer
    

    Gentoo

    Android File Transfer for Linux is now included in Gentoo. You don't have to build anything, just run

    sudo emerge -av sys-fs/android-file-transfer-linux
    

    If you need a FUSE mount helper to mount MTP filesystems, you have to enable the FUSE use flag, e.g. adding the following in /etc/portage/package.use (which can either be a directory or a file):

    sys-fs/android-file-transfer-linux fuse
    

    You can use the sys-fs/android-file-transfer-linux-9999 ebuild if you want the latest Git version by adding the following entry to `/etc/portage/package.accept_keywords (which can either be a directory or a file):

    =sys-fs/android-file-transfer-linux-9999 **
    

    Arch

    sudo pacman -S android-file-transfer
    

    Building from source

    Prerequisites

    • You will need the Qt libraries for building the UI program. If you're planning to use only the library (Qt is not needed), you could turn the option BUILD_QT_UI off.

    • For Ubuntu and other Debian-based distros, use the following command:

      sudo apt-get install build-essential cmake qt5-default ninja-build libfuse-dev libreadline-dev qttools5-dev
      

      For Fedora:

      dnf install make automake gcc gcc-c++ kernel-devel cmake fuse fuse-devel qt-devel readline-devel libqt5-linguist-devel
      
    • Basically

      • you need libqtX-dev or libqt5-dev for the UI,
      • libfuse-dev for the FUSE interface,
      • and cmake, ninja, or make for building the project.

    Building with Ninja

    mkdir build
    cd build
    cmake -G Ninja ..
    ninja
    
    ./qt/android-file-transfer
    

    Building with make

    mkdir build
    cd build
    cmake ..
    make
    
    ./qt/android-file-transfer
    

    Installing binary package on macOS

    There is a binary package that can be installed via Homebrew:

    • First, install brew if you don't have it already installed.
    • Then, the stable package may be installed via:
    brew install homebrew/cask/whoozle-android-file-transfer
    
    • The nightly build may be installed via:
    brew install homebrew/cask-versions/whoozle-android-file-transfer-nightly
    
    • Please note: Stable and nightly are in conflict, so please make sure to uninstall one of them when you want to switch between stable and nightly.

    Building app package on macOS

    You'll need Qt installed to build the GUI app. Here are the build instructions with Qt5 from Homebrew (brew install qt5):

    mkdir build
    cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=~/Applications -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5
    make
    make install
    
    open ~/Applications/android-file-transfer.app
    

    Installation

    sudo ninja install or sudo make install will install the program into the cmake prefix/bin directory (usually /usr/local/bin).

    How to use

    FUSE interface

    mkdir ~/my-device
    ./aft-mtp-mount ~/my-device
    

    Remember, if you want album art to be displayed, it must be named 'albumart.xxx' and placed first in the destination folder. Then copy other files. Also, note that FUSE could be 7-8 times slower than UI/CLI file transfer.

    ZUNE firmware flashing/recovery

    1. Find Zune-Firmware-x86.msi on the internet
    2. Unpack it 7z x Zune-Firmware-x86.msi in some directory, you should get the following files there:
    DracoBaselineCab  FirmwareUpdateXml  KeelBaselineCab  PavoBaselineCab  ScorpiusBaselineCab
    
    1. Find the name of your update in FirmwareUpdateXml. If you're not sure, open Zune Specifications wikipedia page, find your model in "Official Model Numbers" row, and match with "Codename". For instance Zune 4 model 1124 has codename "Scorpius".
    2. Unpack update for your device into some folder using cabextract: cabextract XXXXBaselineCab.

    Here's content of all cabs:

    ├── Draco
    │   ├── EBoot.bin
    │   ├── Games.cab
    │   ├── nk.bin
    │   └── recovery.bin
    ├── Keel
    │   ├── EBoot.bin
    │   ├── Games.cab
    │   ├── nk.bin
    │   └── recovery.bin
    ├── Pavo
    │   ├── EXT.bin
    │   ├── NK.bin
    │   ├── Recovery.bin
    │   └── ZBoot.bin
    └── Scorpius
        ├── EBoot.bin
        ├── Games.cab
        ├── nk.bin
        ├── recovery.bin
        └── xldr.bin
    
    1. Flash firmware files using cli tool. Generally you don't need to flash anything called *boot* or *recovery*. Original software starts with nk.bin, then EXT or Games. Here's an example of how I flash model 1395:
    aft-mtp-cli -v -d 045e:063e # finds Zune HD 16Gb (model 1395)
    
    flash zune/Pavo/NK.bin
    flash zune/Pavo/EXT.bin
    device-reboot
    
    1. Wait until your Zune restarts, it can take a minute or two.
    2. Voila, you don't need to fiddle with Zune software on windows anymore.

    Qt user interface

    1. Start application, choose destination folder and click any button on toolbar.
    2. The options available are: Upload Album, Upload Directory, and Upload Files. The latter two are self-explanatory. Upload Album tries searching the source directory for album covers and sets the best available cover.
    3. You could drop any files or folders right into the application window: the transfer will start automatically.

    Known problems

    Up-to-date list of all known problems and bugs are available here.

    Contacts

    Please do not hesitate to contact me if you have any further questions. My email address is [email protected].

    Special thanks

    • All who filed bugs on GitHub and wrote emails. Many features came to be only because of your feedback. Thanks!
    • Alexey gazay Gaziev for useful suggestions, support, and invaluable help with the MacBook and macOS port.
    • @ssnjrthegr8 for the new logo!

    License

    Android File Transfer for Linux is released under the GNU LGPLv2.1 License.

    Copyright © 2015-2022 Vladimir Menshakov