开发者

Related to ProcessStartInfo() method in C# [duplicate]

开发者 https://www.devze.com 2023-02-17 06:54 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: Related to ProcessStartInfo() method in C#
This question already has an answer here: Closed 11 years ago.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号