How to Inspect USB Port Roles, Connected Devices, and Functions on Android Using ADB dumpsys usb

Modern Android smartphones and tablets feature multifunctional USB Type-C physical ports capable of dynamic role negotiation across diverse hardware configurations. A single USB-C port can operate as a USB device (connecting to a host computer for MTP file transfers or ADB debugging), a USB host (reading flash drives via USB On-The-Go / OTG, external DACs, cameras, and game controllers), or an accessory device under Android Open Accessory (AOA) protocols. Furthermore, USB Power Delivery (USB-PD) negotiates whether the phone sources or sinks electrical power.

When external USB peripherals fail to enumerate, OTG flash drives are rejected, USB-C audio DACs cut out, or moisture/contaminant alerts prevent device charging, inspecting the low-level USB subsystem provides critical answers. The Android Debug Bridge (ADB) provides full diagnostic transparency into this framework through the dumpsys usb command, exposing real-time port roles, connected device descriptors, active USB functions, and HAL hardware states.

Understanding Android’s USB Service Architecture

In Android, USB communication is coordinated by the UsbService system server daemon, which divides functionality into three distinct subsystems:

  • UsbDeviceManager: Manages the device-side personality of the smartphone when plugged into an external host (e.g., toggling between mtp, ptp, rndis tethering, midi, and adb).
  • UsbHostManager: Manages the host controller and USB OTG stack, detecting external peripherals plugged into the phone, reading USB descriptors, and managing per-app USB device permissions.
  • UsbPortManager: Communicates with the hardware USB-C Power Delivery controller to negotiate physical data roles (host vs device), power roles (source vs sink), and detect port contaminants.

Dumping the Complete USB Subsystem State

Connect your Android device to a computer via USB debugging or wireless debugging (adb connect <ip>:<port>). Open a terminal and execute the main diagnostic dump:

adb shell dumpsys usb

The command produces a comprehensive report spanning port configurations, device descriptors, and system properties. To archive this diagnostic report for offline analysis, redirect the command output to a local text file:

adb shell dumpsys usb > usb_report.txt

Inspecting Physical USB-C Port Roles and Power Delivery

USB Type-C supports dynamic role switching known as Dual-Role Data (DRD) and Dual-Role Power (DRP). To inspect the physical hardware port status, examine the UsbPortManager section:

adb shell dumpsys usb | grep -A 20 "USB Port List:"

The output reports key hardware parameters for each physical port:

Port: port0
  Supported Modes: [dual, ufp, dfp]
  Current Mode: ufp
  Power Role: sink (source supported: true)
  Data Role: device (host supported: true)
  Contaminant Detection Status: not detected
  Supports Compliance Warnings: true

Key indicators include:

  • Mode: Indicates whether the port is currently operating in Upstream Facing Port (ufp, device mode) or Downstream Facing Port (dfp, host mode).
  • Power Role: sink indicates the phone is drawing power to charge its battery; source indicates the phone is supplying reverse power to an external peripheral.
  • Contaminant Status: Reports whether moisture, dust, or electrolytic corrosion has triggered safety shutoffs on the USB-C VBUS power lines.

Auditing Active USB Functions in Device Mode

When the phone is plugged into a PC, it presents specific composite USB functions. To determine which functions are currently negotiated and active, query the device manager:

adb shell dumpsys usb | grep -E "(Current Functions:|Default Functions:|mConnected)"

Typical output reveals the active composite personality:

mConnected: true
Current Functions: mtp,adb
Default Functions: mtp

If an expected function fails to initialize—such as MIDI recording or RNDIS Ethernet tethering—this section reveals whether the host OS refused to enumerate the endpoint or if kernel drivers failed to bind.

Inspecting Connected USB OTG Peripherals and Descriptors

When an external device—such as a USB flash drive, DSLR camera, audio interface, or barcode scanner—is connected via OTG, Android’s host manager enumerates the device. To view all attached USB peripherals, run:

adb shell dumpsys usb | grep -A 25 "USB Host State:"

The dump displays full USB specification metadata for each connected accessory:

  • Device Name: The kernel devfs path (e.g., /dev/bus/usb/001/002).
  • Vendor ID (VID) & Product ID (PID): Standard hex identifiers (e.g., Vendor: 0x058f, Product: 0x6387).
  • Manufacturer & Product Strings: Human-readable device names reported by the peripheral firmware.
  • Device Class / Subclass / Protocol: Standard USB Implementers Forum class codes (e.g., Class 08h for Mass Storage, Class 01h for Audio).
  • Configurations & Interfaces: Lists all endpoint descriptors, alternate settings, and maximum transfer packet sizes.

Auditing Per-App USB Permissions and Access Grants

Android restricts direct USB hardware communication. Third-party applications (such as USB camera viewers, drone controllers, or specialized software) must request explicit runtime user permission before opening raw USB file descriptors.

To inspect which applications currently hold permission grants to communicate with attached USB devices, run:

adb shell dumpsys usb | grep -A 15 "Device Permissions:"

The report lists package names (e.g., com.example.usbcamera) alongside the specific USB device IDs they are permitted to open. If an application crashes or reports “USB device not found”, this section will verify whether the operating system has granted permission or if the grant was revoked when the peripheral re-enumerated.

By leveraging dumpsys usb, developers, hardware engineers, and IT administrators can verify USB-C OTG enumeration, diagnose intermittent peripheral disconnects, and troubleshoot charging and data transfer anomalies with complete hardware-level visibility.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.