0

I have an Android device (Samsung Galaxy A20e) and a Windows computer. If I connect both with the USB cable and enable the USB debugging inside the settings of Android, I can connect from my Windows App (.Net C#) by using the ADB interface of the USB device.

The device ID of this interface is \\?\USB#VID_04E8&PID_6860&ADB#8&324af34&11&0003#{dee824ef-729b-4a0e-9c14-b7117d33a817}.

To connect the Android device, I can use CreateFile with FILE_FLAG_OVERLAPPED with the device ID as filename to get a file handle. With this and the WinUsb_Initialize method, I can get a WinUsb handle. This allows me to send data to the Android device.

For example, I can use WinUsb_ControlTransfer with the commands 51, 52 and 53 to start the Android Accessoy Mode.

What else can I do with the ADB USB interface of an Android device?

Is there a description of all features available somewhere?

  • See https://developer.android.com/studio/command-line/adb – Diego Torres Milano Dec 09 '22 at 02:37
  • @DiegoTorresMilano: Your link shows the command line options of the adb.exe file. But I asked about the usage of the USB interface. Or am I too stupid to find wanted info on that page? –  Dec 09 '22 at 04:34
  • The transport doesn't matter, usb, wifi, etc. `adb` is the same regardless of it – Diego Torres Milano Dec 09 '22 at 18:34
  • @DiegoTorresMilano: How do I execute some commands via WinUsb? Until now, I use `WinUsb_ControlTransfer` for this. Where can I find a description, how to use it to run a shell command, for example? –  Dec 10 '22 at 03:19
  • A starting point is https://github.com/cstyan/adbDocumentation – Codo Dec 12 '22 at 08:54

0 Answers0