Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73e942f

Browse files
committed
install apk: display error message if failed
1 parenta8a49f7 commit73e942f

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ private void Window_Closing(object sender, CancelEventArgs e)
11961196
CloseHubPipeAsync();
11971197
}
11981198

1199-
privatevoidCloseThemeEditor()
1199+
privatevoidCloseThemeEditor()
12001200
{
12011201
if(themeEditorWindow!=null)themeEditorWindow.Close();
12021202
}
@@ -3583,24 +3583,38 @@ private void menuInstallLastAPK_Click(object sender, RoutedEventArgs e)
35833583
pars+=$" && adb shell monkey -p{packageName} 1";
35843584
}
35853585

3586-
//Tools.LaunchExe(cmd, pars);
3587-
varprocess=Tools.LaunchExe(cmd,pars,captureOutput:true);
3588-
varoutput=process.StandardOutput.ReadToEnd();
3589-
varerrorOutput=process.StandardError.ReadToEnd().Replace("\r","").Replace("\n","");
3586+
try
3587+
{
3588+
//Tools.LaunchExe(cmd, pars);
3589+
varprocess=Tools.LaunchExe(cmd,pars,captureOutput:true);
3590+
varoutput=process.StandardOutput.ReadToEnd();
3591+
varerrorOutput=process.StandardError.ReadToEnd().Replace("\r","").Replace("\n","");
35903592

3591-
process.WaitForExit();
3593+
process.WaitForExit();
35923594

3593-
// Console.WriteLine(output);
3594-
if(!string.IsNullOrEmpty(errorOutput))
3595+
// Console.WriteLine(output);
3596+
if(!string.IsNullOrEmpty(errorOutput))
3597+
{
3598+
SetStatus("Error installing APK: "+errorOutput);
3599+
}
3600+
else
3601+
{
3602+
// get apk name from path
3603+
varapkName=Path.GetFileName(playerPath);
3604+
if(chkStreamerMode.IsChecked==true)apkName=" (hidden in streamermode)";
3605+
SetStatus("Installed APK:"+apkName);
3606+
}
3607+
3608+
}
3609+
catch(Win32Exceptionex)
35953610
{
3596-
SetStatus("Error installing APK: "+errorOutput);
3611+
// Handle case where 'adb' is not found
3612+
SetStatus($"Error: 'adb' not found. Ensure it's installed and added to PATH. Details:{ex.Message}");
35973613
}
3598-
else
3614+
catch(Exceptionex)
35993615
{
3600-
// get apk name from path
3601-
varapkName=Path.GetFileName(playerPath);
3602-
if(chkStreamerMode.IsChecked==true)apkName=" (hidden in streamermode)";
3603-
SetStatus("Installed APK:"+apkName);
3616+
// Handle other unexpected exceptions
3617+
SetStatus($"An unexpected error occurred:{ex.Message}");
36043618
}
36053619
}
36063620

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp