I'm running adb shell commands using the method described below
System.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();
On the android phone I'm starting an app that records a video so cmd = "adb shell am startservice -n com.xxx.xxx/.xxx".
The problem is that I need to unplug the USB cable after I start recording video. If I do that, the resulting video file won't play. Sometimes it's 0KB. If I leave the USB cable connected, then the video is fine.
Is there a way to perform the adb command so that the video will continue recording after I unplug the USB cable? Everything is fine when I enter the command from the command prompt and unplug the USB cable.
nohup- installbusyboxand usebusybox nohupinstead