Page 1 of 1

Kann ich einen ADB -Shell -Befehl in C# ausführen und ihn nicht unterbrochen haben, wenn ich das USB -Kabel schnelle?

Posted: 03 Jun 2025, 12:01
by Anonymous
Ich leitSystem.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe", "/c " + cmd);
procStartInfo.RedirectStandardInput = true;
procStartInfo.RedirectStandardOutput = true;
procStartInfo.RedirectStandardError = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
< /code>

Auf dem Android -Telefon starte ich eine App, die ein Video so aufzeichnet. Wenn ich das tue, wird die resultierende Videodatei nicht abgespielt. Manchmal ist es 0 KB. Wenn ich das USB -Kabel angeschlossen lasse, ist das Video in Ordnung. Alles ist in Ordnung, wenn ich den Befehl aus der Eingabeaufforderung eingreife und das USB -Kabel ausziehen.