usbip은 Android 휴대폰의 USB 디버깅에 적합하지 않습니다.

usbip은 Android 휴대폰의 USB 디버깅에 적합하지 않습니다.

usbip을 통해 Samsung Android 휴대폰을 원격 서버에 연결한 다음 일부 테스트를 위해 서버 장치에 Android 앱을 휴대폰에 구축하고 싶습니다. IP를 통해 장치를 원격 컴퓨터에 연결할 수 있는 usbip 유틸리티를 발견했습니다. 다음 명령과 출력을 사용하면 내 장치를 올바르게 연결할 수 있고 서버 시스템에 연결된 것을 볼 수 있습니다.

호스트 장치(내 컴퓨터)에서

root@emir-work:~$ usbip bind -b 1-5
usbip: info: bind device on busid 1-5: complete

root@emir-work:~$ usbip list -r localhost
Exportable USB devices
======================
 - localhost
        1-5: Samsung Electronics Co., Ltd : Galaxy series, misc. (MTP mode) (04e8:6860)
           : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-5
           : (Defined at Interface level) (00/00/00)

원격 장치(서버)에서

root[~] # usbip list -r 192.168.0.184
Exportable USB devices
======================
 - 192.168.0.184
        1-5: Samsung Electronics Co., Ltd : Galaxy series, misc. (MTP mode) (04e8:6860)
           : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-5
           : (Defined at Interface level) (00/00/00)

root[~] # usbip attach -r 192.168.0.184 -b 1-5

이 명령 후에는 서버 장치에서 전화에 액세스하여 콘텐츠 등을 볼 수 있습니다. 그러나 USB 디버깅 옵션이 활성화되어 있지 않기 때문에 Android 디버그 브리지가 장치를 인식하지 못합니다. USB 디버깅을 활성화하면 연결이 즉시 끊어지고 장치가 호스트 장치의 usbip에서 자동으로 바인딩 해제됩니다. 다시 바인딩하려고 하면 내보내기 가능한 USB 장치 목록에 표시되지 않고 바인딩되지 않습니다.

다음은 호스트의 관련 저널ctl 로그입니다.

Eki 30 10:18:56 emir-work ModemManager[1091]: <info>  [base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-5': not supported by any plugin
Eki 30 10:18:54 emir-work gvfsd[3747621]: Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Eki 30 10:18:54 emir-work dbus-daemon[2259]: [session uid=1000 pid=2259] Successfully activated service 'org.gnome.Shell.HotplugSniffer'
Eki 30 10:18:54 emir-work dbus-daemon[2259]: [session uid=1000 pid=2259] Activating service name='org.gnome.Shell.HotplugSniffer' requested by ':1.37' (uid=1000 pid=2482 comm="/usr/bin/gnome-shell " lab>
Eki 30 10:18:54 emir-work gvfsd[3747831]: Error 1: Get Storage information failed.
Eki 30 10:18:54 emir-work snapd[1031]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug
Eki 30 10:18:54 emir-work colord[2177]: CdMain: failed to emit DeviceAdded: failed to register object: An object is already exported for the interface org.freedesktop.ColorManager.Device at /org/freedesktop/ColorManager/devices/sysfs__null_
Eki 30 10:18:54 emir-work colord[2177]: CdMain: failed to emit DeviceAdded: failed to register object: An object is already exported for the interface org.freedesktop.ColorManager.Device at /org/freedesktop/ColorManager/devices/sysfs__null_
Eki 30 10:18:54 emir-work colord[2177]: CdMain: failed to emit DeviceAdded: failed to register object: An object is already exported for the interface org.freedesktop.ColorManager.Device at /org/freedesktop/ColorManager/devices/sysfs__null_
Eki 30 10:18:54 emir-work kernel: cdc_acm 1-5:1.1: ttyACM0: USB ACM device
Eki 30 10:18:54 emir-work kernel: usb 1-5: SerialNumber: 330069a3272ba2a5
Eki 30 10:18:54 emir-work kernel: usb 1-5: Manufacturer: SAMSUNG
Eki 30 10:18:54 emir-work kernel: usb 1-5: Product: SAMSUNG_Android
Eki 30 10:18:54 emir-work kernel: usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Eki 30 10:18:54 emir-work kernel: usb 1-5: New USB device found, idVendor=04e8, idProduct=6860, bcdDevice= 4.00
Eki 30 10:18:53 emir-work kernel: usb 1-5: new high-speed USB device number 123 using xhci_hcd
Eki 30 10:18:53 emir-work kernel: usbip-host 1-5: USB disconnect, device number 122

Journalctl을 사용하여 원격 시스템에 로그인합니다.

Eki 30 10:18:36 android-devel gvfsd[10990]: Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Eki 30 10:18:34 android-devel systemd-udevd[11072]: 2-1: Process '/usr/lib/snapd/snap-device-helper unbind snap_cups_ippeveprinter /devices/platform/vhci_hcd.0/usb2/2-1 189:134' failed with exit code 1.
Eki 30 10:18:34 android-devel systemd-udevd[11072]: 2-1: Process '/usr/lib/snapd/snap-device-helper unbind snap_cups_cupsd /devices/platform/vhci_hcd.0/usb2/2-1 189:134' failed with exit code 1.
Eki 30 10:18:34 android-devel systemd-udevd[11072]: 2-1:1.0: Process '/usr/lib/snapd/snap-device-helper unbind snap_cups_ippeveprinter /devices/platform/vhci_hcd.0/usb2/2-1/2-1:1.0 0:0' failed with exit code 1.
Eki 30 10:18:34 android-devel systemd-udevd[11072]: 2-1:1.0: Process '/usr/lib/snapd/snap-device-helper unbind snap_cups_cupsd /devices/platform/vhci_hcd.0/usb2/2-1/2-1:1.0 0:0' failed with exit code 1.
Eki 30 10:18:34 android-devel kernel: usb 2-1: USB disconnect, device number 7
Eki 30 10:18:34 android-devel kernel: vhci_hcd: disconnect device
Eki 30 10:18:34 android-devel kernel: vhci_hcd: release socket
Eki 30 10:18:34 android-devel kernel: vhci_hcd: stop threads
Eki 30 10:18:34 android-devel kernel: vhci_hcd: connection closed
Eki 30 10:18:34 android-devel gvfsd[10990]: PTP: reading event an error 0x05 occurred

디버그 모드의 usbip 데몬은 이 동작이 발생할 때 경고나 오류를 표시하지 않습니다.

두 시스템의 출력을 주목할 가치가 있습니다 usbip version. (usbip-utils 2.0)마지막으로 두 시스템 모두 Ubuntu 20.04.6 LTS를 실행하고 있으며 원격 시스템의 Android Studio 버전은 2022.3.1입니다.

관련 정보