That may be the issue why I can't see my captured videos from my phone when connected to my pc. How do I access PTP and MTP modes? Can't see any options in settings.
Asked
Active
Viewed 2.1k times
7
1 Answers
10
You can do that via adb or a terminal app (in the latter case, ommit the leading adb shell from the examples):
- read settings:
adb shell getprop sys.usb.config - find valid settings:
adb shell grep usb.config= /init*rc - change settings:
setpropwith the appropriate values (e.g.adb shell setprop sys.usb.config "mtp,adb"oradb shell setprop sys.usb.config "ptp,adb")
EDIT: If the above doesn't yield the expected results, it might need root powers. So if your device is rooted, you could try to run adb root prior to above commands. If your device does not accept this ("not available in production builds"), instead run:
PC> adb shell
Android $ su
Android #
Now at the root prompt (#), run above commands without the adb shell prefix (e.g. simply setprop sys.usb.config "mtp,adb").
Izzy
- 91,166
- 73
- 343
- 943
-
1Thanks for this. When I connect my device to OSX it doesn't show the USB connection type toggle, and Android File Transfer doesn't seem to work with MTP mode. This let me switch it to PTP. – Matthew Read Aug 02 '16 at 19:31
-
1Also, for completeness, you'll have to run
adb rootfirst to have the permission to change the setting. – Ullallulloo May 29 '17 at 23:29 -
@Ullallulloo are you sure about that? I cannot remember ever having done that. And the only times I tried, I got an error about
adb rootbeing not available "in production builds". – Izzy May 30 '17 at 06:34 -
@Izzy It silently fails on both my phones without that.
adb rootonly solves it on the rooted one though. The unrooted phone doesn't seem to allow me to change it over adb. – Ullallulloo May 30 '17 at 07:10 -
Thanks, @Ullallulloo – adjusted my answer accordingly. Thinking about it, as I usually placed the settings directly into the proper scripts on the device, I might have executed
setpropwhile already being root – at least after the first tries to figure this out years ago ;) – Izzy May 30 '17 at 08:49 -
it changes the property yes, but it doesn't really enable mtp mode, this is useless, there is something else has to be changed to really trigger mtp mode – user924 Aug 09 '19 at 09:08
-
@user924 it did perfectly back then. Take a look at the date, there were several newer Android versions released since, and something might have changed. I no longer have this issue on any of my devices, so I cannot tell. – Izzy Aug 09 '19 at 18:16
adb shell am start com.android.settings/.UsbSettingsin Command Prompt. – Firelord Aug 24 '15 at 08:17