3

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.

Shlok Jhawar
  • 277
  • 2
  • 3
  • 19

2 Answers2

14

you lacked the "s" in "setFunctions".

 "adb shell svc usb setFunctions mtp" worked for me in Android 9 (lineage OS).
Ender
  • 141
  • 1
  • 3
6

On android 9.0:

adb shell svc usb setFunctions mtp true

The final parameter "true" on the end is optional but false by default as stated in the adb output:

Sets the functions which, if the device was charging, become current onscreen unlock. If function is blank, turn off this feature.

codewing
  • 674
  • 8
  • 25
Adam Higgins
  • 705
  • 1
  • 10
  • 25