Enable MTP using ADB

14,825

Solution 1

you lacked the "s" in "setFunctions".

 "adb shell svc usb setFunctions mtp" worked for me in Android 9 (lineage OS).

Solution 2

On my galaxy S8 (android 9.0 i think), i used:

adb shell svc usb setFunction mtp true

once my phone had been connected to the computer and USB debugging enabled

I think the final parameter "true" on the end is optional but is false by default. I'm not exactly sure what difference it makes all I know is that without the "true" it didn't work.

Share:
14,825

Related videos on Youtube

Shlok Jhawar
Author by

Shlok Jhawar

LabVIEW, Android, Python

Updated on June 04, 2022

Comments

  • Shlok Jhawar
    Shlok Jhawar about 2 years

    How do I enable MTP mode on an Android phone, solely using ADB on the command line? The screen cannot be used and I need to access files. I have USB debugging enabled, though.

    adb shell svc usb setFunction mtp
    

    does not work, oddly.

    • Bo Lawson
      Bo Lawson over 5 years
      Does your Android device have a custom recovery such as TWRP?
  • tuxayo
    tuxayo over 4 years
    In my case I had to use "setFunction". Android 7.1.2 (LineageOS for microG 14.1)
  • Paul Pham
    Paul Pham almost 4 years
    This worked after I connected with TCPIP and accept the authorization dialogue on my phone. ``` adb connect 192.168.1.53:5555 ```
  • enigmaticPhysicist
    enigmaticPhysicist about 3 years
    I had the same issue on the athene running lineageOS 15.1 unofficial.