Related to ProcessStartInfo() method in C# [duplicate]
Possible Duplicate:
Related to ProcessStartInfo() method in C#
开发者_如何学运维I want to pass these arguments in ProcessStartInfo(F:\\Android\\android-sdk-windows\\platform-tools>adb.exe install F:\\P1\\bin\\ANDPROJ1-debug.apk)
so i am passing these arguments just below here but I am getting a exception that The system cannot find the file specified
.
Plz give me solution why this error is coming whereas I am checking all the path correctly.
System.Diagnostics.ProcessStartInfo androidInstallInfo = new System.Diagnostics.ProcessStartInfo();
androidInstallInfo.FileName ="adb.exe";
androidInstallInfo.Arguments = "install F:\\P1\\bin\\ANDPROJ1-debug.apk"; //"install"+" "+ProjectLocation+"\\" + "bin\\" + ProjectName + "-debug.apk";;
androidInstallInfo.WorkingDirectory = F:\\Android\\android-sdk-windows\\platform-tools;
androidInstallInfo.RedirectStandardOutput = true;
androidInstallInfo.UseShellExecute = false;
androidInstallInfo.CreateNoWindow = true;
System.Diagnostics.Process androidProcess = new System.Diagnostics.Process();
androidProcess.StartInfo = androidInstallInfo;
androidProcess.Start();
androidProcess.Close();
It's probably best to set the full path to adb.exe - presumably -
F:\\Android\\android-sdk-windows\\platform-tools\\adb.exe
精彩评论