Skip to content

About

Browse connected mtp devices in any file manager (requires root)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

MTP Mount

One button that mounts a USB-connected MTP device (phone, camera, music player, etc.) into your filesystem at a path any file manager can browse — so you can copy files to and from it with normal apps instead of being stuck with the clunky built-in MTP picker. Root required.

Why this exists

Android is happy to be an MTP device, but when you plug another MTP device into your phone (USB-OTG, host mode) it only exposes it through the Storage Access Framework — a graphical picker that most file managers handle badly and command-line tools can't touch at all. There's no real filesystem path. On desktop Linux this is solved with FUSE-based tools like simple-mtpfs; this app brings the same approach to Android: it runs a bundled, statically-linked simple-mtpfs as root and mounts the device at a folder (default /data/media/0/mtp) that shows up in every file manager on the device.

Requirements

  • A rooted device (Magisk, KernelSU, etc.). The mount is created as root in the global mount namespace so that other apps can see it — the app uses su -M (mount-master) for this. On Magisk, setting the superuser mount-namespace mode to "Global" is not required but doesn't hurt.
  • USB-OTG support, and a cable/adapter to connect the other device.
  • FUSE support in the kernel (guaranteed on Android 11+, and present on most earlier devices).
  • arm64-v8a (64-bit ARM). Other ABIs aren't bundled.

Install

Grab the latest MTPMount.apk from the Releases page and install it. The app can also update itself from within the About screen (root install or system installer).

Usage

  1. Connect the other device with a USB-OTG adapter.
  2. On that device, set the USB mode to File Transfer / MTP.
  3. Open MTP Mount and tap Mount. The device's storage appears at the mount point (default /data/media/0/mtp, which shows up in file managers as /storage/emulated/0/mtp) and can be browsed, copied to, and copied from by any file manager.
  4. Tap Unmount when you're done, or just unplug the device.

While a device is mounted, a notification stays in the shade with an Unmount action. When a device is connected, the app can optionally offer to mount it straight from a notification — see Settings.

Settings

In the About screen:

  • Mount point — where the device is mounted. Default /data/media/0/mtp, the real on-disk path of your internal storage (one layer below /sdcard). Mounting directly under /sdcard or /storage/emulated/0 gets the mount killed by Android's storage daemon; /data/media/0 avoids that, and since it's the same underlying storage the mount still passes through into every app and appears in file managers as /storage/emulated/0/mtp.
  • When a device is connected — one of:
    • Do nothing
    • Show a notification to mount (default) — a tap-to-mount notification appears on connect
    • Mount automatically — mounts silently as soon as an MTP device is detected
  • Theme — System / Light / Dark.

How it works

file manager → kernel VFS → FUSE → simple-mtpfs → libmtp → libusb → /dev/bus/usb → the connected device

Android grabs a connected MTP device with its own handler (com.android.mtp), which blocks direct USB access. The app force-stops that handler, then runs simple-mtpfs as root to register a FUSE mount at your chosen path. simple-mtpfs talks MTP through libmtp, which does raw USB I/O through libusb against /dev/bus/usb — no Storage Access Framework involved. Because the mount is made in the global mount namespace, it propagates into other apps' namespaces, which is what lets any file manager see it.

The simple-mtpfs process is held alive by a foreground service for the lifetime of the mount, so it can't be reaped in the background.

Logs

The main screen has a View logs button showing everything the mounter prints, with a Copy button. That's the first place to look if a mount fails.

Building

The app

Builds entirely on-device in Termux — no Gradle, no Android Studio. You need aapt2, ecj, d8, apksigner, zip, plus an API 33+ android.jar and framework-res.apk in ~/.android/ (see the app-template it's based on for setup).

./build.sh

Output is MTPMount.apk. build.sh also bundles any native/<abi>/*.so into the APK and works around a quirk in Termux's ecj wrapper that otherwise hides newer Android API symbols.

The native binary

simple-mtpfs (with libmtp, libusb, libfuse, libiconv) is cross-compiled statically with the Android NDK and committed at native/arm64-v8a/libsimplemtpfs.so. See native/README.md for how it's built.

License

GPL-3.0 — see LICENSE.

Bundled components: simple-mtpfs (GPL-2.0), libmtp (LGPL-2.1), libusb (LGPL-2.1), libfuse (LGPL-2.1), libiconv (LGPL-2.1).

About

Browse connected mtp devices in any file manager (requires root)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages