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.
Related videos on Youtube
![Shlok Jhawar](https://lh4.googleusercontent.com/--tM6jNO5A98/AAAAAAAAAAI/AAAAAAAAB4c/WKZLAmigvSg/photo.jpg?sz=256)
Comments
-
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 over 5 yearsDoes your Android device have a custom recovery such as TWRP?
-
-
tuxayo over 4 yearsIn my case I had to use "setFunction". Android 7.1.2 (LineageOS for microG 14.1)
-
Paul Pham almost 4 yearsThis worked after I connected with TCPIP and accept the authorization dialogue on my phone. ``` adb connect 192.168.1.53:5555 ```
-
enigmaticPhysicist about 3 yearsI had the same issue on the athene running lineageOS 15.1 unofficial.