Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/ListMobileDevices.Automation.cs
jonathan adamczewski 5765f4595e AutomationTool: Remove UE4 references
#jira UE-111740
#preflight none
#trivial

#ROBOMERGE-AUTHOR: jonathan.adamczewski
#ROBOMERGE-SOURCE: CL 18576039 in //UE5/Release-5.0/... via CL 18576055
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18576072 by jonathan adamczewski in ue5-release-engine-test branch]
2022-01-11 15:15:59 -05:00

55 lines
1.3 KiB
C#

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