Files

16 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ads-usb:可选虚拟 ADB USB 设备
源码在 `src/`(Rust);`main.rs` 管理回环监听和会话,`descriptors.rs` 提供 ADB/WinUSB 描述符,`protocol.rs` 实现 USB/IP 1.1.1、控制请求、批量传输、URB 取消与 ADB 帧适配。依赖 USBip 虚拟控制器的 Windows 后端已验证,程序本身不包含内核驱动。
```powershell
cargo build -p ads-usb --release --locked
# 先运行 ads-client --no-auto-connect,取得远端设备租约
.\bin\ads-usb.exe --listen 127.0.0.1:3240 --upstream 127.0.0.1:15555 --serial ADS-home-phone
& 'C:\Program Files\USBip\usbip.exe' --tcp-port 3240 attach -r 127.0.0.1 -b 1-1 --terse --once
adb -s ADS-home-phone shell getprop ro.product.model
```
USB/IP 只监听回环,不能向公网发布。进程只允许一个导入者,上游直接使用本机 ads-client 的 adbd 字节流,不是 ADB server 5037。无需远程手机实际 USB 插线;远端可以仍通过 LAN adbd 接入。关闭本次 ads-usb 进程会断开本次虚拟设备。
仅提供 ADB 接口;不提供 MTP、fastboot 或整台手机 USB 透传。Windows 安装、使用和验证见 [windows-usb.md](../docs/windows-usb.md)。