Skip to content

USB Commands and Sysfs Utilities


Setting USB Functions

Set the current USB function. If the function is blank, sets to charging."

adb shell svc usb setFunctions

Set the functions which, if the device was charging, become current on screen unlock

adb shell svc usb setScreenUnlockedFunctions [function]

Get the list of currently enabled functions

adb shell svc usb getFunctions [function]

USB Gadget Utilities

Reset USB gadget

adb shell svc usb resetUsbGadget

Reset the specified connected USB port

adb shell svc usb resetUsbPort [port number]

Get current USB speed

adb shell svc usb getUsbSpeed

Get current Gadget Hal Version

adb shell svc usb getGadgetHalVersion

Get USB Hal Version

adb shell svc usb getUsbHalVersion