Kann ich einen ADB -Shell -Befehl in C# ausführen und ihn nicht unterbrochen haben, wenn ich das USB -Kabel schnelle?
Posted: 02 Feb 2025, 17:02
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 aufzeichnet. /p>
Das Problem ist, dass ich das USB -Kabel nach dem Aufnehmen von Videos ausziehen muss. 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. Kabel? Alles ist in Ordnung, wenn ich den Befehl aus der Eingabeaufforderung eingreife und das USB -Kabel ausziehen.
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 aufzeichnet. /p>
Das Problem ist, dass ich das USB -Kabel nach dem Aufnehmen von Videos ausziehen muss. 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. Kabel? Alles ist in Ordnung, wenn ich den Befehl aus der Eingabeaufforderung eingreife und das USB -Kabel ausziehen.