我尝试通过直接连接使用 adb,即通过端口 5037 使用 telnet,基本命令(如“host:devices”)返回与等效 adb 命令相同的答案:
C:\adb>adb devices
List of devices attached
4d009c06c8459000 device
Run Code Online (Sandbox Code Playgroud)
C:\adb>telnet localhost 5037
Connecting to localhost...
Sent: 000Chost:devices
Received: OKAY00184d009c06c8459000 device
Run Code Online (Sandbox Code Playgroud)
但是当我尝试像“shell”这样的“设备”命令时,我收到错误:
C:\adb>adb shell ls
acct
cache
charger
config
...
...
Run Code Online (Sandbox Code Playgroud)
C:\adb>telnet localhost 5037
Connecting to localhost...
Sent: 0008shell:ls
Received: FAIL0012device offline (x)
Run Code Online (Sandbox Code Playgroud)
怎么了?