SharpAdb / AdvancedSharpAdbClient

AdvancedSharpAdbClient is a .NET library that allows .NET, Mono and Unity applications to communicate with Android devices. It's improved version of SharpAdbClient.
https://sharpadb.github.io
Apache License 2.0
198 stars 54 forks source link

May I ask how to execute adb tcpip 5555 and other adb commands without predefined methods? Thank you! #62

Closed rvhome closed 1 month ago

rvhome commented 1 year ago

Describe your question

May I ask how to execute adb tcpip 5555 and other adb commands without predefined methods? Thank you!

wherewhere commented 1 year ago

I am not sure it can work.

var adbSocketFactory = Factories.AdbSocketFactory;
var EndPoint = new IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort);
using IAdbSocket socket = adbSocketFactory(EndPoint); 
await socket.SendAdbRequestAsync("host:tcpip:5555", cancellationToken); 
AdbResponse response = await socket.ReadAdbResponseAsync(cancellationToken); 
string result = await socket.ReadStringAsync(cancellationToken);

Mybe you can direct execute adb.exe through Process.

rvhome commented 1 year ago

Thank you for returning the unknown host service. After removing host:, there is no return value, so we can only use process first