Change USB connection mode using ADB only (broken screen)
Late as I am to the party the following might be of some help:-
https://trubitsyn.dev/posts/adb-connectivity
The command svc usb setFunction &lt;mtp|ptp|rndis|midi&gt; is the most likely candidate (alternatively setFunctions is used dependant on the version of Android.