Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/ListMobileDevices.Automation.cs
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

54 lines
1.3 KiB
C#

// Copyright 1998-2017 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.GetPlatform(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);
}
}
}
}