Skip to content

Commit e86d7f9

Browse files
Better editor logging for device portal
1 parent b0eb6a1 commit e86d7f9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Assets/MixedRealityToolkit/_Core/Utilities/BuildAndDeploy/UwpBuildDeployWindow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ private static async Task InstallOnTargetDeviceAsync(string buildPath, DeviceInf
12921292

12931293
if (string.IsNullOrEmpty(PackageName))
12941294
{
1295+
Debug.LogWarning("No Package Name Found");
12951296
return;
12961297
}
12971298

@@ -1347,6 +1348,7 @@ private static async Task InstallAppOnDevicesListAsync(string buildPath, DeviceP
13471348
{
13481349
if (string.IsNullOrEmpty(PackageName))
13491350
{
1351+
Debug.LogWarning("No Package Name Found");
13501352
return;
13511353
}
13521354

Assets/MixedRealityToolkit/_Core/Utilities/WindowsDevicePortal/DevicePortal.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ public static async Task<bool> InstallAppAsync(string appFullPath, DeviceInfo ta
360360
var isAuth = await EnsureAuthenticationAsync(targetDevice);
361361
if (!isAuth) { return false; }
362362

363+
Debug.Log($"Starting install on {targetDevice.MachineName}...");
364+
363365
// Calculate the cert and dependency paths
364366
string fileName = Path.GetFileName(appFullPath);
365367
string certFullPath = Path.ChangeExtension(appFullPath, ".cer");
@@ -497,12 +499,14 @@ public static async Task<bool> UninstallAppAsync(string packageName, DeviceInfo
497499
return false;
498500
}
499501

502+
Debug.Log($"Attempting to uninstall {packageName} on {targetDevice.MachineName}");
503+
500504
string query = $"{string.Format(InstallQuery, FinalizeUrl(targetDevice.IP))}?package={UnityWebRequest.EscapeURL(appInfo.PackageFullName)}";
501505
var response = await Rest.DeleteAsync(query, targetDevice.Authorization);
502506

503507
if (response.Successful)
504508
{
505-
Debug.LogFormat("Successfully uninstalled {0} on {1}.", packageName, targetDevice.MachineName);
509+
Debug.Log($"Successfully uninstalled {packageName} on {targetDevice.MachineName}.");
506510
}
507511
else
508512
if (!response.Successful)
@@ -630,7 +634,7 @@ public static async Task<string> DownloadLogFileAsync(string packageName, Device
630634
return string.Empty;
631635
}
632636

633-
string logFile = $"{Application.temporaryCachePath}/{targetDevice.MachineName}_{DateTime.Now.Year}{DateTime.Now.Month}{DateTime.Now.Day}{DateTime.Now.Hour}{DateTime.Now.Minute}{DateTime.Now.Second}_deviceLog.txt";
637+
string logFile = $"{Application.temporaryCachePath}/{targetDevice.MachineName}_{DateTime.Now.Year}{DateTime.Now.Month}{DateTime.Now.Day}{DateTime.Now.Hour}{DateTime.Now.Minute}{DateTime.Now.Second}_player.txt";
634638
var response = await Rest.GetAsync(string.Format(FileQuery, FinalizeUrl(targetDevice.IP), appInfo.PackageFullName), targetDevice.Authorization);
635639

636640
if (!response.Successful)
@@ -820,6 +824,10 @@ public static async Task<bool> EnsureAuthenticationAsync(DeviceInfo targetDevice
820824
// Strip the beginning of the cookie header
821825
targetDevice.CsrfToken = targetDevice.CsrfToken.Replace("CSRF-Token=", string.Empty);
822826
}
827+
else
828+
{
829+
Debug.LogError($"Authentication failed! {response.ResponseBody}");
830+
}
823831

824832
if (!string.IsNullOrEmpty(targetDevice.CsrfToken))
825833
{

0 commit comments

Comments
 (0)