user2642132
user2642132

Reputation: 31

Using ADB to enable File transfer mtp, USB debugging enabled, device set to charging

I have a tablet I am using for automated testing. It is set to usb debugging. If the pc reboots or cable is disconnected/reconnected the unit defaults to usb configuration = charging, but usb debugging is always enabled. adb does not detect the device. I have to manually set usb from charging to mtp file transfer for it to be detected by adb. The goal is to programmatically change the device from charging to mtp file transfer if connected or the pc reboots. Any suggestions?

Upvotes: 3

Views: 8053

Answers (1)

Bluey
Bluey

Reputation: 61

you should be able to enable MTP over ADB with the command

adb shell svc usb setFunctions mtp

Upvotes: 6

Related Questions