Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/ListMobileDevices.Automation.cs
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

54 lines
1.3 KiB
C#

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System.Collections.Generic;
using AutomationTool;
using UnrealBuildTool;
namespace AutomationScripts.Automation
{
public class ListMobileDevices : BuildCommand
{
public override void ExecuteBuild()
{
Log("======= ListMobileDevices - Start =======");
var GlobalParams = new ProjectParams(
Command: this,
RawProjectPath: new FileReference(@"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.");
}
Log("======= 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)
{
Log("Device:{0}:{1}", PlatformName, DeviceName);
}
}
catch
{
throw new AutomationException("No {0} devices", PlatformName);
}
}
}
}