How to execute simple adb commands not abd shell ones?
What can we do for you?
Hello,
Is there a way to send simple adb commands?
I would like to retrieve a folder from my device but I can't find a way to do it.
Thank you.
This project is direct communicate with adb service. If you want to communicate with adb client, just use Process to send command.
Thanks for your quick reply.
Actually I don't know the difference between adb shell and adb but I have been able to send my command using Process.
That was my previous solution to send adb and adb shell commands. I just thought that I could send all commands using AdvancedSharpAdbClient.
adb.exe is adb client. It communicates with adb service to process commands. This project is a csharp version of adb client to connect with adb server directly.
Some command is not available in adb server, such as adb install-multiple, which is approved by adb client. If you want to send not-shell command, you can use:
var adbSocketFactory = Factories.AdbSocketFactory;
var EndPoint = new IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort);
using IAdbSocket socket = adbSocketFactory(EndPoint);
await socket.SendAdbRequestAsync("your command", cancellationToken);
AdbResponse response = await socket.ReadAdbResponseAsync(cancellationToken);
string result = await socket.ReadStringAsync(cancellationToken);
I haven't found the list of adb service command. I only known that if you want to send shell ls, the command is shell:ls. And if you want to send version, it is host: version. You can find this commands by search this repo.