Я уже писал что-то подобное
Код: Выделить всё
var adb = Process.Start(new ProcessStartInfo("adb", "shell")
{
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
});
ArgumentNullException.ThrowIfNull(adb);
var outputTask = Task.Run(async () =>
{
while (!adb.StandardOutput.EndOfStream)
{
var line = await adb.StandardOutput.ReadLineAsync();
Console.WriteLine(line);
}
});
adb.StandardInput.WriteLine("ls");
adb.StandardInput.WriteLine("cd sdcard/DCIM/Camera");
adb.StandardInput.WriteLine("touch -d \"2011-01-01 00:00:00\" receipt_660cb153bd075.jpg");
adb.StandardInput.WriteLine("stat receipt_660cb153bd075.jpg");
Подробнее здесь: https://stackoverflow.com/questions/790 ... diagnostic
Мобильная версия