Reputation: 31
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
Reputation: 61
you should be able to enable MTP over ADB with the command
adb shell svc usb setFunctions mtp
Upvotes: 6