Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/ListMobileDevices.Automation.cs
Peter Sauerbrei dc1d815f84 refactored the logging system for UAT/UBT to be more like UE4
we now use an enum similar to UE4 with Fatal, Error, Warning, Display, Log, Verbose, and VeryVerbose
Log will only go to the log file unless -verbose is passed on the command line
reduced some of the output from UAT to be Log only

[CL 2631062 by Peter Sauerbrei in Main branch]
2015-07-23 14:51:46 -04:00

52 lines
1.2 KiB
C#

using System.Collections.Generic;
using AutomationTool;
using UnrealBuildTool;
namespace AutomationScripts.Automation
{
public class ListMobileDevices : BuildCommand
{
public override void ExecuteBuild()
{
LogConsole("======= ListMobileDevices - Start =======");
var GlobalParams = new ProjectParams(
Command: this,
RawProjectPath: @"D:\UE-Main\UE4\Samples\Games\TappyChicken\TappyChicken.uproject"
);
if (ParseParam("android"))
{
GetConnectedDevices(GlobalParams, Platform.Platforms[UnrealTargetPlatform.Android]);
}
if (ParseParam("ios"))
{
throw new AutomationException("iOS is not yet implemented.");
}
LogConsole("======= ListMobileDevices - Done ========");
}
private static void GetConnectedDevices(ProjectParams Params, Platform TargetPlatform)
{
var PlatformName = TargetPlatform.PlatformType.ToString();
List<string> ConnectedDevices;
TargetPlatform.GetConnectedDevices(Params, out ConnectedDevices);
try
{
foreach (var DeviceName in ConnectedDevices)
{
LogConsole("Device:{0}:{1}", PlatformName, DeviceName);
}
}
catch
{
throw new AutomationException("No {0} devices", PlatformName);
}
}
}
}